0

I am using xampp to host my website local. I am making a WordPress site with the MySQL database from xampp.

Now, I bought a new computer and took backup of my WordPress folder. Now when I try to open my WordPress site on my new computer, I get the error: Error establishing a database connection I can image this is because the database that is linked to the WordPress site is not on my new system.

I formatted my old drive so I cannot restore the old database. Is there a work around?

1
  • 2
    If you don't have a copy of your old database, then you're out of luck. You'll need to start again with a fresh database install. Commented Feb 16, 2017 at 7:51

4 Answers 4

2

If you have your old database file (.sql) then you can just

  1. Run this link from your browser http://localhost/phpmyadmin.
  2. Select Database which you want to upload the SQL file. (If no DB , create new database).
  3. Click on Import option from top menu section and upload you files.

and for taking backup of your database on Xampp 1. Run this link from your browser http://localhost/phpmyadmin. 2. Select Database which you want to take backup of. 3. Click on Export option from top menu section and backup your files.

Sign up to request clarification or add additional context in comments.

Comments

1

If your old drive is completely formatted, and you weren't using any sort of Wordpress backup plugin, then no, you won't be able to rebuild the site. Sorry! As well as storing your content (posts / articles), your Wordpress database also stores information on which plugins you were using, so it is an critical part of rebuilding any Wordpress site.

Next time around, you should export your database to a file (eg .sql), so you can import it on your new server/laptop. You would achieve this by either using a Wordpress plugin, or on XAMPP by using phpMyAdmin. You could also do this with 3rd party apps, like SequelPro or MySQLWorkbench.

You should have your images and static assets saved - eg css files, uploaded images, so you have something to start with, if you decide to rebuild your site without the database.

Comments

1

You need to install your wordpress site again with new database. You already lost it. Always backup your wordpress site. You can backup your wordpress site with this plugin and it's free- https://wordpress.org/plugins/updraftplus/

Thanks
BanyanTheme

Comments

1

Step 1: Backup your database on the old computer.

Step 2: Restore the database onto the new computer.

Step 3: Run file install in wordpress

Good luck!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.