WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Backup to Dropbox
[resolved] How to restore the database from backup (4 posts)

  1. briankross
    Member
    Posted 1 year ago #

    Hello,

    I'm moving from shared hosting to a virtual private server and need to restore my site from the WordPress Backup to Dropbox backup. I know my way around cPanel, phpMyAdmin and other tools enough to be dangerous, but could use a hand with restoring the database.

    In my WP to Dropbox backup I see two .sql files:
    user_db-backup-core.sql
    user_db-backup-plugins.sql

    When I create a new database on my new server, and attempt to import "user_db-backup-core.sql" I get an error "#1044 - Access denied for user 'user'@'localhost' to database 'user_db'"

    On the new server, the database name that I want my backup to overwrite is different, the user is also different.

    I'm assuming that the general process is to overwrite a blank new database with the backup "user_db-backup-core.sql" first, then "user_db-backup-plugins.sql" next.

    Thoughts?

    http://wordpress.org/extend/plugins/wordpress-backup-to-dropbox/

  2. briankross
    Member
    Posted 1 year ago #

    Ok, I honestly have no idea if this is the right thing to do, but I believe I have it working.

    I opened up the two backup .sql files in TextWrangler (I'm on a Mac):
    user_db-backup-core.sql
    user_db-backup-plugins.sql

    I looked for the text below calling to create a database if it does not exist, (I have a new blank database to overwrite), and block commented the section (/* */), then saved both files:

    BEFORE

    --
    -- Create and use the backed up database
    --
    
    CREATE DATABASE IF NOT EXISTS user_db;
    USE user_db;

    AFTER

    --
    -- Create and use the backed up database
    --
    
    /*CREATE DATABASE IF NOT EXISTS user_db;
    USE user_db;*/

    I then used phpMyAdmin, selected the new blank database I wanted to populate, went to the import tab, browsed for the edited "user_db-backup-core.sql" files and hit "go", then browsed for the edited "user_db-backup-plugins.sql" file and hit "go". Both times I saw a green section on top showing what was imported.

    Since I have a new database name, database username, and database password, I had to change the config.php file for wordpress to reflect this.

    I think all is well, thoughts?

  3. nelsondpt
    Member
    Posted 1 year ago #

    i see people helping each other isnt common here... :\

  4. Michael De Wildt
    Member
    Plugin Author

    Posted 1 year ago #

    Spot on. If you want to import it to a different DB you will need to comment out those lines.

    I am in the process of writing a restore tool that will allow you to do this more easily.

    Cheers,
    Mikey

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic