Avishay28
Avishay28

Reputation: 2456

Copy a database from old WAMP installation folder to another

I just install a fresh copy of WAMP, and I want to import couple of databases from the old one to the new one, so I entered to the old mysql data directory C:\wamp-old\bin\mysql\mysql5.7.14\data, and copy the relevant databases there to the new data directory. But when I try to access the tables in phpmyadmin, I get a message saying that the tables aren't exists, but they do: enter image description here

What am I missing?

Upvotes: 10

Views: 18739

Answers (6)

user3337831
user3337831

Reputation: 1

  • Stop the wamp server
  • Copy the entire data folder from the old WAMP to the new WAMP directory

for MariaDB

  • old directory: C:\wamp64_old\bin\mariadb\mariadb10.4.10\data
  • new directory: C:\wamp64\bin\mariadb\mariadb10.4.10\data

For MySql

  • old directory: C:\wamp64_old\bin\mysql\mysql8.0.18\data
  • new directory: C:\wamp64\bin\mysql\mysql8.0.18\data
  1. start the WAMP server again.

Upvotes: 0

Ravi Bhadauria
Ravi Bhadauria

Reputation: 119

I did it successfully just now:

  1. make a copy of wamp folder (wamp-old)
  2. uninstall the wamp
  3. install the new wamp (overwrite all the files if u were asked)
  4. start the wamp
  5. ck the localhost and phpmyadmin
  6. copy your databases from the old-wamp only from C:\wamp-old\bin\mysql\mysql5.7.14\data and paste to the same location in new wamp
  7. then copy and paste ibdata file from the above path and replace in new one.

You are done!

Upvotes: 7

Joye
Joye

Reputation: 1

Stop the Service (because it will complain for a file opened by another app) then Just copy and paste the ENTIRE (...\data) file from old installation folder backup to the new installation by overwirting the existing new installation file.

Finally, start the service.

Upvotes: -1

Simos Santorinias
Simos Santorinias

Reputation: 21

In my case the mySQL version of my old Wamp installation (5.7.26) was very different from the one in my new Wamp installation (8.0.21), so nothing from the solutions here worked for me. I downloaded the old version of mysql from https://wampserver.aviatechno.net/#mysql_versions , installed it and replaced the hole ‘data’ folder with my old one. Now from Wamp\MySQL\Version menu I can choose the old version and all my old databases are working fine. You can leave that working version of mySQL or export the databases and import them to the new mySQL version.

Upvotes: 2

Mwangi Thiga
Mwangi Thiga

Reputation: 1369

You forgot to copy the ibdata file. enter image description here

Upvotes: 21

K.Suthagar
K.Suthagar

Reputation: 2306

you can not restore databases like this way,

Please follow this steps to restore the databases from old to one,

  1. Backup all the databases using phpmyadmin (Export Feature)
  2. Install the fresh XAMPP
  3. Restore the all the databases using phpmyadmin (Import Feature)

Upvotes: 1

Related Questions