How to access cyberpanel website files and import/export db dumps using ssh

hey my friend
Please how i reache to my website files with ssh in cyberpanel (ssh) my os is ubuntu when i login to my server and run command (ls)

i need soluation to run commands :
compress folder with ssh
extract folder with ss
import databse via ssh
export databse via ssh

Thanks

Welcome @gaber Happy you are here

Run

$ cd /home/mydomain.com/public_html
## compress folder with ssh
$ apt install zip
$ zip -r wp-content.zip wp-content
## extract folder with ss
$ unzip wp-content.zip
## import databse via ssh
$ mysql -u username -p domain_db1 < /home/mydomain.com/public_html/websitedump.sql

OR

$ mysql -u root
mysql> use domain_db1
mysql> source /home/mydomain.com/public_html/websitedump.sql;

## export database via ssh
$ mysqldump -u root -p domain_db1 > websitedump.sql
## export multiple databases
$ mysqldump -u root -p ---databases domain_db1 domain_db2 domain_db3 > fullwebsitedump.sql

Change mydomain.com to your specific domain

Some of these questions are cyberpanel unrelated however I answerd them. I encourage you to check StackOverflow or go to MariaDB documentation to learn more.

1 Like

thanks josephgodwinke

works with me i can now reache my website files
please how can i reache mysql databse to imort or export large databse with ssh

Thanks