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_domains
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.
Websites:
domains
records
websiteFunctions_websites
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