Copy a database from old WAMP installation folder to another - mysql

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:
What am I missing?

You forgot to copy the ibdata file.

I did it successfully just now:
make a copy of wamp folder (wamp-old)
uninstall the wamp
install the new wamp (overwrite all the files if u were asked)
start the wamp
ck the localhost and phpmyadmin
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
then copy and paste ibdata file from the above path and replace in new one.
You are done!

you can not restore databases like this way,
Please follow this steps to restore the databases from old to one,
Backup all the databases using phpmyadmin (Export Feature)
Install the fresh XAMPP
Restore the all the databases using phpmyadmin (Import Feature)

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.

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.

Related

How to Recovering mysql database from data folder backup from uninstalled xamp to newly installed xamp

I have uninstalled the old XAMPP and deleted all of the content of d:\xampp folder and installed the new one. When I copy my backup folder (with the name of my database, containing all .frm and .opt files) to the D:\xampp\mysql\data, the database shows in the list in phpmyadmin but it has no tables and data. What I've done wrong?
tables are show in the database but while clicking on table its saying file doesn't exist..
Probably you have not deleted the main file phpmyadmin
You should to search phpmyadmin in xampp file and delete phpmyadmin and past you're file in xampp again
before you past phpmyadmin be sure you've delete it completely
When you restore old mysql\data\ to new installed xamp, your newly installed xamp version must be same as old xamp version.
Then only restore data will work. its worked on my xamp

How to Restoring MySQL database from physical files

Unfortunately I uninstalled Xampp in my windows machine, there are about 50 databases in /xamp/mysql/data folder. I have not taken backup script, but I have a copy of Xamp/mysql/data folder.How can I restore MySQL Databases using that Data Directory.
Thanks in Advance
I was find out solution
Install new xampp
Copy your old database folder from
xampp\mysql\data\databasefolder to Paste in your running xampp folder
C:\xampp\mysql\data
After that stop mysql and apache service then backup your running xampp files ib_logfile0,ib_logfile1 and ibdata1 and store in safe place
Then Copy same file (ib_logfile0,ib_logfile1 and ibdata1) from old
xampp\mysql\data\ and paste in your running xampp server C:\xampp\mysql\data\
Start mysql and apache service Open CMD Fire command
C:\xampp\mysql\bin>mysqldump -u dbusername -p dbpassword dbname>D:\exportdb.sql
stop mysql and apache service and restore your main ib_logfile0,ib_logfile1 and ibdata1 file (check Step 3)
after than again start service and open http://localhost/phpmyadmin/ and import database backup from D:\exportdb.sql
Now your backup is working :)
Install the same Server version again, Stop it , copy the datadir and Start the servrr
I experienced with my Mac, before selling to a friend simply copy the XAMPP folder only to my hard drive.
(NOT SUCCESS) Unfortunately, it was bringing trouble to me, because I tried the following steps:
- I install fresh XAMPP and copy the whole \httdocs and var\mysql to my new Mac, those db only with .frm and .ibd, NOT WORKING, I can't still access the tables inside PHPMyAdmin ...
- I tried to install the same xampp version and repeat the above steps, still NOT WORKING.
- Decided to go to bed.
(SUCCESS)
- This morning, I brought my backup disk and try with Windows 7.
- Install fresh latest XAMPP for Windows, c:\xampp
- I have one of website (folder) from my backup \httdocs and correspond database folder inside \var\mysql are READY in my windows 7, I just want to try with one website then try the rest because I have many projects inside httdocs\ and \var\mysql
- I copy the mention httdocs\ folder to windows c:\xampp\httdocs and copy the \var\mysql to c:\xampp\mysql\data
NOT LAST YET
I copy the ib_logfile0, ib_logfile1, ibdata1 from my backup file to windows xampp c:\xampp\mysql\data
I refresh the http://localhost/mywebsite
WOW WOW DONE ... it's working...
In my case I found pretty straight solution.
I had db files in wamp and ported to laragon
Stopped laragon instance, no apache/mysql was running.
I have simply copied db folder[dbname] "example /mysql/data/dbname" from wamp to laragon "/mysql/data/" folder
Than I started my laragon instance both apache/mysql.
I have checked in phpmyadmin, I can see same database was recovered and now part of current mysql database.

Mysql database didn't working after overwritting installing wamp.

I am using wamp server. I have made some project and there are some also databases.
I install new window and then i install wamp server in same drive where the wamp sever is.
After installing wamp my project file in "www" are present as pervious but in phpMyAdmin there is only database name is present when I open it there is no table. where the tables gone ???
I check the "wamp>mysql>data". Here the files are present of that tables but it does not show in the phpmyadmin.
I need these tables how can I recover it.
I suggest to you ,use the feature in windows called "restore previous versions" .
Right click the Wamp folder click Restore previous versions and select the most recent date you know it was working,it maybe work for you.
I assume you mean that you did ...
Install new windows.
Install WampServer on new windows
Copy my old\wamp\www folder to the new install
Copy the subfolders in \wamp\bin\mysql\mysql{version}\data to the new install
If this is correct, then dont forget to copy the contents of \wamp\bin\mysql\mysql{version}\data as well. If you are using INNODB database the actual data lives in the ibdata1 file in that folder.

WAMP Mysql database version change

Can someone help me out of this error?
I had old version of wamp, because of virus I have formatted my computer, although I have backed-up the "wamp\bin\MySQL\mysql5.5.24\data". Now, I have installed the new version of "WAMP". It comes with the new "mysal5.6.12\data", I have tried to copy "data" in that folder but it not works.
My entire database which I have backed-up, is not working so, please somebody help me how to do that.
Uninstall your current WAMP server.
Install your previous version of WAMP server.
Import your database from your data file.
Export your whole database as SQL.
Install new version of WAMP server.
Import your new SQL to new WAMP server.
I got this fixed up after some troubles.
You can reinstall all your data by copying over the contents from the old wamp server to the new one
Just check your new mysql version and into wamp/bin/your version/data backup that folder into /backups
Then copy over wamp/bin/your old version/data to the folder above wamp/bin/your version/data
This should load wamp server but with an orange icon
Go to the backups folder and copy the mysql, perfomance schema and test folders into the new
That should work out
If you have troubles let me know

Restore Database in WAMP

I had few databases related to different projects in the WAMP. I don't know what happened, Today, when I go to PhpMyAdmin, I was just able to see the default databases and rest of my databases are not showing and even the php code related to those databases are throwing database not found errors. But when I go to "D:\wamp\bin\mysql\mysql5.1.30\data" the folders with my DB names are there. But not sure how to restore those DBs and I don't have any backup of the DB, Can any one help me how to restore them?
You can copy these file to another location and reinstall the same WAMP version after installtation copy them back to original location.
Please note that your WAMP version should be same, because if the version will change then mysql version will also be change.
Another method is to utilise Window's "Restore previous versions" feature. Right click the wamp folder (usually in C:\, click Restore previous versions and select the most recent date you know it was working.
Note: This will also revert mysql data - so you'll lose any changes after the date you select, but I have used this in the past when I needed to get my whole wamp system back to a working state when something had broken it.
Have you checked my.ini file? Just find datadir it should refer to db folder (e.g datadir=D:/Wamp/bin/mysql/mysql5.1.30/data) - goodluck :)
Copy the complete data folder from old wamp mysql folder to new mysql folder and then inside data folder change the name of the file mysql-bin.index to mysql-bin.index-corrupt. Then restart WAMP. That's all.
reinstall Wamp Server that must be same version. After reinstall if wamp show red icon 1. go to wamp -> apache -> services ->test port 80.
if its available . then apache -> services -> install services.
2. mysql-> services -> install services.
after that restart wamp..
100% work
Copy data folder and reinstall same version of WAMP.
Once installation is completed, go to data folder: inside replace only ibdata1 file from existing folder.
After starting WAMP, check phpmyadmin: you'll get all database and tables with data.