[ Urgent ] I deleted the cyberpanel database accidently. please help, What can I do now!

There were 116 Databases in PHP my admin, and 106 Databases were abandoned, 10 Database is currently in use by my Websites, So I deletes 106 unwanted databases, after I droped unwanted databases Cyberpanel page showing Server Error (500), because, I also deleted Cyberpanel Database.

What Can I do now (without losing website configurations) Please help me!

(all my websites are running well with no issue. Only the cyber panel not Working.)

If you deleted the cyberpanel database, you lost the DNS configurations as they were inside it.
Were you using cloudflare for the websites?

If so, I can send you my cloudflare → cyberpanel exporter to retrieve the DNS.

Yet all the other configurations are gone.

1 Like

yes, I use cloudflare.
my all websites is running well.

Everything is running Good, Just Cyber Panel page showing Server Error (500)

Alright, let me check the cyberpanel database to see if anything important was lost or not.
But at least importing the DNS from cloudflare to cyberpanel I can fix it. Let me check the rest and will reply back in some minutes

1 Like

ok I am looking foreward, let me know if you need more info.

Issue Clarify:

I deleted all databases, from PHP my admin, except my websites databases, after that Cyberpanel page showing Server Error (500), My All websites and everything working properly except Cyberpanel

Alright so, if you had emails and such, those records need to be manually recreated, as well as some other tables at the MySQL, for each website.
But well, it is doable just will take quite some time.

My Cloudflare->cyberpanel DNS exporter was for a single website, was editing it for multiple, sorry for the delay.

Can you send me your anydesk by pm?

1 Like

I want to restore Cyberpanel, without losing my websites data, I mean, I just do not want lost my websites, Is there any way to do that?

@tmoore, solved my issue perfectly, very skilled person. @tmoore, recreated Cyber panel database manually and connect and input all the things to database correctly, It was very troublesome work. it took 1.2 hour. @tmoore has very good skill and knowledge.

Thanks @tmoore for your good work. all my websites, emails and cyber panel working perfectly.

If someone else also deleted their “cyberpanel” database, here are the steps to help you restore it:

1 - Run this command to recreate the database structure:

sh <(curl https://raw.githubusercontent.com/tbaldur/cyberpanel-mods/main/restore_cyberpanel_database.sh || wget -O - https://raw.githubusercontent.com/tbaldur/cyberpanel-mods/main/restore_cyberpanel_database.sh)

2 - Login to your cyberpanel with the newly generated password (the command above will generate and show you it on the console)

3 - At cyberpanel, go to Databases → phpMyAdmin

Tables that you need to manually recreate:

If you had emails:
e_users : Here leave the password field empty. You can continue to use your current password. Updating the password from cyberpanel will then update this value and fix it.


If you use Cloudflare and have your DNS there, you can re-import them to Cloudflare using my script.
Download the script:

(curl https://raw.githubusercontent.com/tbaldur/cyberpanel-mods/main/cloudflare_to_powerdns.sh -o cyberpanel.sql || wget -q https://raw.githubusercontent.com/tbaldur/cyberpanel-mods/main/cloudflare_to_powerdns.sh)

Edit the first 3 lines.

api_key = Cloudflare API key
email = Cloudflare email
domain_name = The domains you want to import from Cloudflare to your cyberpanel

After editing the file, run it:

chmod 777 cloudflare_to_powerdns.sh && ./cloudflare_to_powerdns.sh

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.