0

I was working on a site offline. Now, due to some reason, it's not working. I've tried almost everything. To save time, I have setup a fresh mysql and wordpress site.

Now, I have theme files and database folder files like: dp.opt and wp_addonlibrary_addons.frm. How can I properly upload them?

I tried to manually do it, but some error came saying these tables already exist.

Please advice.

Udo E.
  • 2,665
  • 2
  • 21
  • 33
Tariq Majeed
  • 31
  • 1
  • 4
  • Hi Tariq Majeed. So you have a new WordPress website and want to migrate the theme and the database from an older WordPress website into this new one? – Tiago Martins Peres Oct 28 '19 at 11:24
  • Current site is not working as xampp mysql is down and wont start. That's why I have setup a new xampp and need to transfer my site. – Tariq Majeed Oct 29 '19 at 06:09
  • Do you get any error when you try to start it? – Tiago Martins Peres Oct 29 '19 at 06:19
  • Theme transfer completed but database upload upload give errors sometimes that these tables already exists on local xampp when using on chrome and sometimes that database is not is proper format etc on phpmyadmin. – Tariq Majeed Oct 29 '19 at 06:30
  • Im now speaking when you try to start MySQL on XAMPP. We're gonna be able to fix it together so you won't have to create a new WordPress installation. Just need you to share the error you get when trying to start it – Tiago Martins Peres Oct 29 '19 at 06:35
  • Mysql is not starting and not showing any error. On chrome Localhost (xampp) is showing "error establishing a database connection." – Tariq Majeed Oct 30 '19 at 07:50
  • i am getting error "Error Establishisg a database connection" also i cant access in phpmyadmin – Tariq Majeed Oct 30 '19 at 07:55
  • Can you share a screenshot of your XAMPP panel before you try to start and after? If yes, then do it (edit your question to add them). In the panel, what do you get in your logs? Also, to which folder have you installed XAMPP? Have you installed MySQL before installing XAMPP? Is "mysqld.exe" running (check Task Manager)? – Tiago Martins Peres Oct 30 '19 at 08:05
  • https://paste.pics/a744abed4e2cf1fa596c7c5969a47d5d – Tariq Majeed Oct 30 '19 at 08:11
  • Close XAMPP, run it as admin and try to start mysql again. If that doesn't work, best is to uninstall XAMPP (removing everything you've got left from it) and install it again (in the location C://xampp). – Tiago Martins Peres Oct 30 '19 at 08:35
  • i have loose database in phpmyadmin so how can i recover now – Tariq Majeed Oct 30 '19 at 09:11
  • https://stackoverflow.com/a/35895901/5675325 – Tiago Martins Peres Oct 30 '19 at 09:29

1 Answers1

0

I assume your questions is about importing the DB again in MySQL? Are you still able to export the database from your not working site? Than you could do this (source):

mysqldump --add-drop-table -u user -p > dumpfile.sql

And import it again on your new site with this command:

mysql -u user -p < dumpfile.sql

You won't get the error about already existing tables.

If you can't reach the old database anymore or not able to export, drop the current database first on your new site (make sure you made a backup).

DROP DATABASE databasename
CREATE DATABASE databasename

You can also drop all tables instead of dropping the database. You can use this script: https://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/ Or my preferred method is using PHPMyAdmin to drop all tables. Then re-import with:

mysql -u user -p < dumpfile.sql 
Erjen Rijnders
  • 248
  • 1
  • 4
  • 10