WordPress.org

Ready to get started?Download WordPress

Forums

Restoring Blog posts after failed domain switch (4 posts)

  1. garrettgibbons
    Member
    Posted 2 years ago #

    Short story: I suck at wordpress.

    Longer story:

    I wanted to move a blog from http://www.domain.com/blog to http://www.domain.com.

    First, I backed up all of the html files via FTP, then backed up my SQL file using MySQL (via Hostmonster's cPanel). What I didn't do was export my blog directly from the wordpress dashboard.

    Second, I removed files from the root level (removing the previous domain-level page) and then uploaded my wordpress install backup via FTP.

    Third, I went into the settings of the /blog (old location) install and set both the WordPress address and site address to the new location (probably a mistake to change both, according to several articles I've read since then).

    Fourth, nothing worked. I couldn't get back into the old install to fix anything (or export a clean archive from WordPress) nor did the new install work. I still have the clean database file but I accidentally replaced the original WP index.php with the post-armageddon version in my backup.

    Now, I've attempted several times to create a clean install of WP using automated scripts in cPanel (easy as can be), and then delete the database files and bring in backup SQL database file. That seems to allow the old blog to load in the new (root-level) URL but when I attempt to access wp-admin functions I get errors saying that it can't connect to the database.

    It seems like I should be able to restore the entire blog at the original location (I still have the database backup and a backup of all of the main content), but I'm missing something.

    I've read around 40-50 wordpress-related articles and forum threads related to specific facets of this process and I'm generally confused about what my path forward should be. Most guides assume that an export direct from WP had been made, and I don't understand why my database replacement attempts aren't working. My guess is that it's related to the new domain, but I'm flummoxed.

    Can anyone please help?

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    This is often caused by not properly modifying the wp-config.php file (in WP root) with the correct database information. Always refer to the WordPress Codex for proper information on working with WordPress.Org sites, like this one on backing up a database

    Also, hopefully, your webhost maintains full site and database backup and can restore your original site. Discuss with them.

  3. garrettgibbons
    Member
    Posted 2 years ago #

    Yes, I had been living by that Codex page you linked to - it's the restore process that's causing problems. I'm sure that I have bungled the wp-config.php file somewhere but it wasn't something as obvious as the legacy "Localhost" vs "localhost" bug.

    Regardless, I hadn't thought of contacting the host (I tend to rely only on my own backups). I just contacted them and they're restoring it all now to where it was last night (which is perfect). Hallelujah and thank you for bringing it up!

  4. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    You are welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.