• Resolved dave8441

    (@dave8441)


    I created a staging site to troubleshoot an issue I was having on my real site. After ruling out a plugin conflict or theme as the cause, it seems the only thing left is an issue with the database. I have a database backup gzip file that was made before the issue began, but I have no idea how to restore it to the staging site. Can this be done, and if so, how?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rene Hermenau

    (@renehermi)

    Hello Dave,

    is this a mysql dump that you created manually by using phpmyadmin?
    It’s a complex process to restore a sql file created on a different site on another website. You can do the import via phpmyadmin to the staging site but after that you will need to do a search and replace for all occurances of the URL.

    You could create a locally hosted wordpress site and make it available on the same domain by doing an adjustment in the host file. Then you could import the sql file to that local website but there is no option in wp staging to restore a raw sql file that has been created with another tool.

    On the other hand, if you have a wpstg backup file created with wp staging, you could restore that backup on the staging site.

    I am sorry for not having a better answer to you.

    Thread Starter dave8441

    (@dave8441)

    Hi Rene,

    Thank you for your excellent reply! I made the database backup by using cPanel>Backup Manager>cPanel backups. I have never used phpmyadmin, so I would be getting in way over my head to go that route.

    Perhaps there might be an easier way to troubleshoot the issue I am having. I did make a full backup of my site via cPanel before my issue began in mid-June. But I would rather not restore it and lose all the recent changes. Maybe there is a way to create a staging site by using that backup? If not, perhaps I can ask my hosting provider to use it to make a temporary site. What do you think?

    Plugin Author Rene Hermenau

    (@renehermi)

    > ?If not, perhaps I can ask my hosting provider to use it to make a temporary site. What do you think?

    I would recommend trying that first.

    You could create a staging site and then ask your hosting provider to restore the SQL backup on that staging site.

    However, the problematic thing is that cPanel does not allow a migration. They just restore the backup, and after that, all URLS and paths will still link to the old site while the new staging site uses different values.

    So after that, you will need to adjust values in the DB to get access to the site and then use other tools to search & replace all the other values left in the database.

    Unfortunately, its not a trivial one-click process.

    If this is all about debugging and the issue you have in the database, you could optionally try activating the debug.log and then checking the logs files.
    They will often tell you what problem you have with the website:

    https://wp-staging.com/docs/enable-wordpress-debug-log-mode/

    Thread Starter dave8441

    (@dave8441)

    Okay, thanks for the info.

    One more question before I try your suggestions… I do have a DB backup of the live site that I made via cPanel before my issue began. I thought about restoring it to troubleshoot my issue, but so far I have assumed that restoring an old DB backup after any changes to the site were performed is a bad idea. Am I correct?

    Plugin Author Rene Hermenau

    (@renehermi)

    If you restore the backup your whole site will be resetted to that backup and all changes made to the site after restoring the backup will be lost.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to restore database backup to staging site?’ is closed to new replies.