-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restoring the Apostrophe database from backup #4092
Comments
Hey @programarivm, |
Thanks for the swift response @BoDonkey. I think it should be a one-liner command for MongoDB 4.4. One reason to stay away from MongoDB 5 is it requires CPU support for AVX instructions. See turnkeylinux/tracker#1724 |
I guess it all depends on your hosting model. Many of our clients use Atlas, so their host server for the Apostrophe instance(s) doesn't matter as much. |
This is what I'd do to dump the database after Setting up Apostrophe.
Not too sure if it is correct. |
This one did the trick.
For further information: |
Now I'm having trouble to restore my database. It seems as if something may be wrong with using hyphens in a MongoDB database name:
Dev teams may be tempted to use hyphens in their database names like "apos-app" or "a3-boilerplate" causing unexpected issues. |
Finally this is how I am restoring the database.
I hope this helps. |
We use database names without hyphens on a regular basis btw, with all supported MongoDB versions. I recommend the |
BTW @BoDonkey, I was wondering if these two commands could be run in the root folder of the Apostrophe site: Dump:
Restore:
If so, does it make sense to
|
I recommend:
mongodump --uri="mongodb://localhost:27017/my-database-name" --archive
--gzip > mydatabasedump.tar.gz
mongorestore mongodb://localhost:27017/ --nsInclude="my-database-name.*"
--archive --gzip --drop < mydatabasedump.tar.gz
No need for a folder, and it is possible to connect these commands in a
Unix pipeline.
Yes, listing the database name in the URL in the first command but not the
second feels odd, but you'll get warnings if you use "--db" or a fully
qualified URL with a database name with mongorestore these days.
…On Wed, Mar 15, 2023 at 12:39 PM Jordi Bassaganas ***@***.***> wrote:
BTW, I was wondering if these two commands could be run in the main folder
of the Apostrophe site:
Dump:
mongodump --db myapp
Restore:
mongorestore --db myapp dump/myapp
If so, does it make sense to mkdir a dump folder? What about adding the
following lines to the .gitignore file?
...
# Restore the database from backup
/dump/*
!/dump/.gitkeep
—
Reply to this email directly, view it on GitHub
<#4092 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27L4W5EJH2FYV7UQJ5DW4HWCTANCNFSM6AAAAAAV3Q5HCE>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Hi there,
I've created my first Apostrophe site. As a newbie, I'd expect the docs to describe how to dump and load a MongoDB 4.4 database in a one-liner command.
Example:
Thank you,
The text was updated successfully, but these errors were encountered: