Backing up and restoring data is an extremely important part of running servers. It's a virtual safety net against most bad things that can happen....
For further actions, you may consider blocking this person and/or reporting abuse
Hi, I have tried to replicate this guide and everything works fine except the database restore, I get this error: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'mysqldump: Got error: 1045: "Access denied for user 'user'@'localhost' (using...' at line 1
I think you need to make sure your target database has the same user credentials.
For now, I managed to restore the files and the database without any problems. Now, there is a problem. The files do not work, apparently they were restored but it is not possible to access or download them.
dev-to-uploads.s3.amazonaws.com/up...
dev-to-uploads.s3.amazonaws.com/up...
Make sure you use the same encryption key in your env file
You mean, this one? _APP_OPENSSL_KEY_V1
Yep :)
I think there is a typo/bug in the user part of the database backup command. I think it should be:
Thanks for pointing this out ;)
Took a while but we got to it! It should be fixed now <3
Thanks! Looks like the same typo is in the mariadb restore command too.
I think people have also had problems migrating if they don't migrate their
appwrite-certificatesand maybeappwrite-configvolume. This is because the database has data about certificates generated, but the certificates don't actually exist on disk so HTTPS doesn't work.If you didn't get a chance to backup those, you can try to manually delete the certificates info in the database manually.
$and>characters to indicate whether the command is executed in the shell or mysql CLI, respectively:Credits to @kodumbeats for the SQL queries.
I'm trying to backup my database ... but dump.sql seems to be empty... please advise
i'm typing this into cmd where the .env file located
docker-compose exec mariadb sh -c exec mysqldump --all-databases --add-drop-database -u user -p password > ./dump.sql
Hey there 👋 Tiny syntax mistake, it should be:
Still does not work for me on Appwrite v15
I was not able to back up maria db all the scripts in this article only produces a 0byte backup file
docker-compose exec mariadb sh -c exec mysqldump --all-databases --add-drop-database -u"root" -p"$MYSQL_ROOT_PASSWORD" > ./dump.sql
And how to backup/restore on MacOS?
You can't imagine how many times have I opened this article 😅 Thanks a lot for this article!
Your restore/backup gist helps tremendously. I just migrated local dev to the ☁. One suggestion I'd like to make is to delete the cloud function deployments and use only the latest one. The backup I moved was 800MB because of those deployments. Other than that, 100% confirmed it works to a tee.
As of now with Appwrite 1.2.0, I deleted some rows in other tables.
delete from
_console_domains;//show domain permissions
select * from \_console_domains_perms;//delete domain permissions
delete from_console_domains_perms;rsync is our friend when moving to a new server.
rsync -avz --progress backups/backup-2023-03-21T02-05-16.tar.gz root@[targetServer]:/root/appwrite/backups/backup.tar.gz2023-03-21T02-05-16.tar.gz is the source file to copy
backup.tar.gz is the target because that is the name restore.sh expects to find alongside it.
Issue certificates
docker-compose up -ddocker compose exec appwrite ssl domain="app.mydomain.com"
I don't seem to get it, even after running the above commands i still get an empty dump.sql file
I found this solution on discord:
here , what i did and it works
backup data :
docker-compose exec mariadb sh -c 'exec mysqldump --all-databases --add-drop-database -u"user" -p"password"' > ./dump.sql
restore data :
docker-compose exec -T mariadb sh -c 'exec mysql -u”user”-p"password"' < dump.sql