We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to save data
How to save data
Hello.
I have files with database and files of the site.
BUT i cant restore database complitely...
Where i have a mistake?
I install vestaCP on Debian 8, then add some sites and create some empty databases (my_db).
Then i copy the same named files above empty databese and go to phpmyadmin.
I can see there for about 150 tables but i cant open it (wrong rights).
So i have changed rights to this folder and files to "chmode -R mysql:mysql /var/lib/mysql/my_db"
After if i can see only 30-37 tables and have access to half of them..
But, for example, in phpmyadmin search i can see all tables... But cant search in them...
HOW can i restore database complitely??
P.S.
When i get debian and install apache +php5+mysql+phpmyadmin and go to the phpmyadmin...
Create database and copy my database above empty i get the same result..
I have files with database and files of the site.
BUT i cant restore database complitely...
Where i have a mistake?
I install vestaCP on Debian 8, then add some sites and create some empty databases (my_db).
Then i copy the same named files above empty databese and go to phpmyadmin.
I can see there for about 150 tables but i cant open it (wrong rights).
So i have changed rights to this folder and files to "chmode -R mysql:mysql /var/lib/mysql/my_db"
After if i can see only 30-37 tables and have access to half of them..
But, for example, in phpmyadmin search i can see all tables... But cant search in them...
HOW can i restore database complitely??
P.S.
When i get debian and install apache +php5+mysql+phpmyadmin and go to the phpmyadmin...
Create database and copy my database above empty i get the same result..
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: How to save data
you cannot restore a DB straight from the MySQL dbstore /var/lib/mysql/my_db
On the source server, you need to EXPORT your DBs with mysqldump command
Copy exportedfile.sql on the VestaCP server, then import it using
On the source server, you need to EXPORT your DBs with mysqldump command
Code: Select all
mysqldump dbname > ./exportedfile.sql
Code: Select all
mysql dbname < ./exportedfile.sql
Re: How to save data
I understand and know about Import/Export but the trouble is that i cant run old server beacouse of some errors on disk.. I can only copy files from it..
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: How to save data
oh... well, will be a bit tedious. You will need to copy the entire /var/lib/mysql/ directory to the new server and then copy it back to a fresh server with MySQL installed.
In Depth article here
in nutshell
Backup Entire MySQL Data Directory /var/lib/mysql/ (on Crashed Server)
Restoring an Entire DBMS From Backup (On new server)
extract copied tarbal to
additionally
In Depth article here
in nutshell
Backup Entire MySQL Data Directory /var/lib/mysql/ (on Crashed Server)
Code: Select all
systemctl stop mysql
tar -cvf mysql.tar /var/lib/mysql/
transfer it to the new server
Code: Select all
systemctl stop mysql
mv /var/lib/mysql/* /someplacesafe
Code: Select all
/var/lib/mysql/
Code: Select all
chown -R mysql:mysql /var/lib/mysql
systemctl restart mysql
Code: Select all
mysqlcheck --all-databases -o
mysqlcheck --all-databases --auto-repair
mysqlcheck --all-databases --analyze