0

So my webhoster closed down, where I hosted my Wordpress blog. I was able to receive a zip file containing all my data. I now have a new webhoster and I extracted the zip file to its root directory.

Trying to open my website now gives me "Error establishing database connection". The web tells me it may be related to hardcoded urls in the Wordpress database, which I need to replace by the new url.

However the tutorials usually tell you to use the Wordpress interface to create a backup of my database first, which can then be edited in tools like phpmyadmin. I can not access the Wordpress interface anymore and so far did not manage to edit the database otherwise.

I tried placing a local copy of the blog in the "C:\xampp\htdocs" folder, hoping phpmyadmin would recognize the database and allow me to edit it. Not working, maybe I am doing something wrong?

Any ideas to revive my Wordpress blog?

Cheers

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
br0t
  • 37
  • 2
  • 7
  • Does your zip contain the sql dump file? – AO_ Mar 07 '14 at 12:54
  • Hi, no I don't think so. The archive has been manually created by the webhosting guy, I guess an sql dump must be triggered somehow, or is it created automatically? – br0t Mar 07 '14 at 13:01
  • Seems `noobish` that the `webhosting guy` would only give you the files back and not the accompanying database itself where all the content is really stored.... Maybe look around for a `.sql` file otherwise you will need to modify your `wp-config.php` file and create a new wordpress database. https://codex.wordpress.org/Installing_WordPress#Step_2:_Create_the_Database_and_a_User – AO_ Mar 07 '14 at 13:06
  • Actually I think I am the noob. Thanks to your comment I had another look at the mail the guy send me and besides the ZIP it also included a link to a shared directory containing what seems to be all files related to the database (lots of .frm, .myd, .myi files, db.opt and some .BAK). Now I just need to find out how to place this on my new webhoster so it is found... Is it common to have a "www" and "mysql" directory on the server root? – br0t Mar 07 '14 at 13:13
  • I suggest you revise: http://stackoverflow.com/questions/879176/how-to-recover-mysql-db-from-myd-myi-frm-files – AO_ Mar 07 '14 at 13:40

1 Answers1

0

Okay I think I got it working. For people having the same issue:

  1. I loaded the database locally by copying the *.myd, *.myi, *.frm files to a new folder in my local xampp installation (e.g. C:\xampp\mysql\data\myDatabase).

  2. I then used phpmyadmin to export this database to a .sql file.

  3. On my webserver I then installed a fresh wordpress blog. It might be enough to copy your existing wordpress stuff, without needing to do this step afterwards, not sure.

  4. My webhost has phpmyadmin preinstalled, so I used that to delete the fresh wordpress databases and import the .sql file instead. Now everything is in place, but since I changed my domain I need to change the URL paths in the database.

  5. I used this script (use it by placing it on your webserver in the wordpress root folder and calling it in the browser) to do a search&replace of my old url to the new url: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

  6. After that I only had to manually fix the path to my header image that I had edited in the past in the theme's header.php file.

Phew. Thanks for your help f00644.

br0t
  • 37
  • 2
  • 7