Title: WordPress Migration And Localhost
Last modified: August 20, 2016

---

# WordPress Migration And Localhost

 *  Resolved [Buxykay](https://wordpress.org/support/users/buxykay/)
 * (@buxykay)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/)
 * Hi, I need help fast if possible. I had this bad luck to be hacked and the hosting
   service had to delete my database. Fortunately(or unfortunately), I have a mysql
   database backup since my last post.
 * Now since the database and my site are no longer on the hosting, I installed 
   wordpress on my localhost on my computer with the intention to export the posts
   in xml format and then import it on another wordpress installation on another
   host. I want to use the same domain name.
 * After importing the database into phpmyadmin on my computer, I wanted to see 
   what I have done and this is where problems started. The front page(home page)
   showed a list of recent posts as well as the widgets on the side bar although
   the theme is different. As I clicked the links to the posts, they returned error.
   I wanted to go to the admin panel but I was redirected to the url with “Error
   establishing a database connection”.
 * Please I need help how I can use the database backup to retrieve my posts which
   are well over 300.
 * PLEASE HELP ME SOMEBODY!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345326)
 * are you sure the local `wp-config.php` has the correct database details?
 *  Thread Starter [Buxykay](https://wordpress.org/support/users/buxykay/)
 * (@buxykay)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345332)
 * Thanks Samuel for your reply. I configured the localhost wp-config.php exactly
   as the one on the hosting. The same Database name, the same user and password.
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345333)
 * that may be the problem
    on my xampp installs (and I understand wamp is the same)
   the databse user is `root` and there is no password
 * use the db creation part of this guide to create another database and test
    [http://tamba2.org.uk/wordpress/xampp/](http://tamba2.org.uk/wordpress/xampp/)
 *  Thread Starter [Buxykay](https://wordpress.org/support/users/buxykay/)
 * (@buxykay)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345334)
 * Yes I first created a database on my xampp and then imported the database back
   up. When I installed the new wordpress the posts urls were displayed but on clicking
   them they directed me to the former url and displayed the error message.
 *  [Nikki Blight](https://wordpress.org/support/users/kionae/)
 * (@kionae)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345346)
 * If you don’t change the values of siteurl and home in the wp_options table, WordPress
   will redirect you to whatever domain was originally specified.
 * Set those two records in the database to [http://localhost/whatever-the-path-is](http://localhost/whatever-the-path-is)
 *  Thread Starter [Buxykay](https://wordpress.org/support/users/buxykay/)
 * (@buxykay)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345437)
 * Thanks Kionae and Samuel B. I finally succeeded to retrieve my posts. Thanks 
   for your support.
 * This is what I did:
    1. Opened up the sql file in wordpad
 * 2. I then used the Edit –> Replace function which replaced the new url with the
   old one
 * 3. Imported the sql file into pühpmyadmin. This created a database on my localhost
   with the same name and data.
 * 4. Launched wordpress from my localhost and then
 * 5. In the admin panel Tools –> Export –> All contents in xml format.
    Now this
   is where I met with problem again. As I wanted to import the generated xml file
   into my new server, I got error that the limit is 2M and the xml is 2.1M. Is 
   there a way round this?
 * I decided to export and import by categories which was time consuming but I made
   a few then I got tired doing this and wanted to know if there is an easier method.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘WordPress Migration And Localhost’ is closed to new replies.

## Tags

 * [MySQL database](https://wordpress.org/support/topic-tag/mysql-database/)
 * [phpmyadmin](https://wordpress.org/support/topic-tag/phpmyadmin/)
 * [Wordpress Migration](https://wordpress.org/support/topic-tag/wordpress-migration/)

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 6 replies
 * 3 participants
 * Last reply from: [Buxykay](https://wordpress.org/support/users/buxykay/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-migration-and-localhost/#post-2345437)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
