WordPress.org

Ready to get started?Download WordPress

Forums

Online Backup for WordPress
Restoring Database from Backup (5 posts)

  1. JupiterJim
    Member
    Posted 2 years ago #

    The instructions on your website at the FAQ page say:

    "The database folder will contain a MySQL file that can be imported via phpMyAdmin (already installed on most commercial web servers) into a new empty database to recreate the WordPress database as it was at the time of backup."

    Question: What do we do with the old database for this WordPress site that is still on the server? If I create a new database does it matter what I name it?

    Thanks for your help.

    ~ Jupiter Jim

    http://wordpress.org/extend/plugins/wponlinebackup/

  2. Online Backup
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Jupiter Jim,

    Hope you are well!

    I admit the FAQ does need improving. The database restore bit is more from when we didn't do the filesystem. I'll provide some additional bits here for now. Might seem long but I've tried to be as accurate and detailed as possible!

    If you are restoring just the database, you just download a backup of the existing database from your web host Control Panel (just in case), then wipe the database clean by dropping all the tables inside of it. Best not drop the actual database as it will drop any permissions and users attached to it too. Once emptied, the backup can be restored into the empty database. All this can be done in phpMyAdmin.

    If you are restoring both filesystem and database, you'll restore the files to the server, but then it won't work because the database won't be populated. So what you'll need to do is peek inside the wp-config.php you restored to the server. If on Windows, best to open in WordPad. NotePad doesn't understand the file encoding and shows it all on one line which is a nightmare. Right near the top you'll see something like this:

    // ** MySQL settings - You can get this info from your web host ** //
    
    /** The name of the database for WordPress */
    
    define('DB_NAME', 'database');
    
    /** MySQL database username */
    
    define('DB_USER', 'username');
    
    /** MySQL database password */
    
    define('DB_PASSWORD', 'password');

    Just like when you install WordPress, you generally create a database and a username for that database, inside your Control Panel. So you'll need to do the same again with the same database name (DB_NAME), same username (DB_USER) and same password (DB_PASSWORD). Then you can restore the database backup into the database using phpMyAdmin.

    If you already have a functional WordPress and want to recover over the top of it, you'll do similar to above, but a little different if you want to use the same database. You could just download all the existing files, then delete them from the server (just in case), then restore the filesystem. Then you can use your Control Panel to download a manual backup of the existing database before deleting it. Then follow the above to create the database as it says inside wp-config.php.

    Or, to use the existing database, first download all the files (you'll need one of them), then delete them from the server. Then examine the wp-config.php you downloaded. It will look the same as above and you'll be able to note the database name (DB_NAME), username (DB_USER) and password (DB_PASSWORD). You can then restore from your Filesystem backup to the server, and edit the wp-config.php you restore to have the same DB_NAME, DB_USER and DB_PASSWORD. Once done, you can then download a backup of the existing database using your web host Control Panel (just in case), drop all the tables in the existing database, and then restore the database backup from our plugin.

    So it overall, it's fairly straightforward. And I aim to help where I can on the forum. We have been looking at recovery options in the plugin so we've not ruled out having it all automated at some point - it's just a delicate thing to do automatically as it involves overwriting stuff so it would need to be done right!

    Although... to throw a spanner in the works, this is restoring to the original location - that is, the domain must remain the same. If you were on http://www.myblog.com, you need to still be on http://www.myblog.com. You won't be able to migrate to another domain using the backup without extra work. This is a WordPress limitation. More information on this can be found at http://codex.wordpress.org/Moving_WordPress. It's not straightforward but it can be made to work, and the main issue becomes some plugins and themes that store the domain name and need their settings saving again to make it notice the change.

    Hope this helps - I'm ready for any questions.

    Jason.

  3. ilaria12
    Member
    Posted 1 year ago #

    hello, when I created the full backup with the plugin I chose encrypt none, so it result to be a file .zip but if I unzip I can't cos it says is uncrypted, so I uploaded via ftp in the decrypt folder of the plugin, but in the Decrypt Backup page of the plugin doesn't happen what is written: The files will appear above when the page is refreshed.
    How do I do?
    many thanks

  4. Online Backup
    Member
    Plugin Author

    Posted 1 year ago #

    Hi ilaria12,

    If you didn't encrypt the backup it doesn't need to be unencrypted. So it won't appear on the Decrypt a Backup. We'll make this more clear in time and I'm drafting some big step by step guides to restore backups that we'll publish. We've also started a project to make it so the restore can be done by running a simple script to make it much much easier.

    Regards,

    Jason

  5. Online Backup
    Member
    Plugin Author

    Posted 1 year ago #

    Hi ilaria12,

    To clarify, the file you have should be "WPOnlineBackup_Full.zip" or something. Just extract the contents. You'll see your database and filesystem data. Then the above guide should help you do what you need to do with those.

    If not, just raise a new topic I'll answer any questions you may have.

    Jason.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic