WordPress.org

Support

Support » Localhost Installs » Installing a WP site to a local host from a downloaded backup

Installing a WP site to a local host from a downloaded backup

  • I’m attempting to install a WP site to a local host that I had backed up from an automated backup plugin. I’ve had this site backed up on a hard drive since mid 2012 and would like to install it to a subdomain as an example of work. Unfortunately, I backed this site up before I knew anything about databases and how to migrate WP from one server (or a local host) to another server. I am now comfortable with that process. However, I seem to be having some difficulty establishing a database that is recognized by MAMP.

    So far I have downloaded and installed WP to my local host.
    I do have the original database name, UN, PW as retrieved from the wp-config.php file.
    Unfortunately, this site is no longer available on a live server. I am only working with the downloaded WP files.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Do you have the backup of the database? You need to import it using phpMyAdmin.

    Yes, but when I tried to import it, I got the following message:

    Error
    SQL query:

    — ——————————————————–

    — Table structure for table wp_commentmeta

    CREATE TABLE wp_commentmeta (

    meta_id BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    comment_id BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ‘0’,
    meta_key VARCHAR( 255 ) DEFAULT NULL ,
    meta_value LONGTEXT,
    PRIMARY KEY ( meta_id ) ,
    KEY comment_id ( comment_id ) ,
    KEY meta_key ( meta_key )
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;

    MySQL said: Documentation

    #1050 – Table ‘wp_commentmeta’ already exists

    esmi

    @esmi

    Forum Moderator

    You are trying to import into a pre-populated database. Try creating a new database.

    Created a new empty db in MAMP with a different name, and then tried to import the backup .sql and got the same message as above.

    esmi

    @esmi

    Forum Moderator

    Are you sure that you are trying to import into the correct database?

    It’s the only one that I know of. Inside my WP Content Folder are two files called:
    hastensdb-backup-core.sql
    hastensdb-backup-plugins.sql

    They were generated by the wp2db (wordpress to drobbox) plugin.

    The server where the site was installed no longer has cpanel or phpmyadmin access, so I can’t go export the database. I was, however, still able to log into the server via FTP and copy the entire website folder contents. I don’t know if that will help though?

    I am no expert, but I move databases between desktop, laptop and remote server frequently. The way I do it is:

    1. Create a backup using mysqldump on a Windows PC or the standard Debian backup on the server.
    2. Edit the backup file to change the domain name and folder names etc., using Notepad++ on a Windows PC. Depending on which way the database is moving, the DB is uploaded/downloaded before/after editing.
    3. Using a MySQL Command Line Interpreter “use dbname;” followed by “source editedbackup;”. Insert your file database names. I use Putty for the server.

    Very basic approach and you have to know what you are doing, but works for me.

    that I had backed up from an automated backup plugin.

    Perhaps contact the plugin developer for the method to restore from this plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Installing a WP site to a local host from a downloaded backup’ is closed to new replies.