[{"data":1,"prerenderedAt":676},["ShallowReactive",2],{"sidebar-posts":3,"post-count":78,"post-\u002Fset-up-automatic-backups-for-parse-server-on-digital-ocean":79,"page-\u002Fset-up-automatic-backups-for-parse-server-on-digital-ocean":667,"neighbours-\u002Fset-up-automatic-backups-for-parse-server-on-digital-ocean":669,"post-projects-\u002Fset-up-automatic-backups-for-parse-server-on-digital-ocean":674},[4,8,12,16,19,23,27,31,35,39,43,47,50,54,58,62,66,70,74],{"path":5,"title":6,"date":7},"\u002Fbuilding-take-contentin-mobile-app","I built a ContentIn mobile app in one night and tested it from the sauna","2026-10-29",{"path":9,"title":10,"date":11},"\u002Fmac-mini-claude-code-dev-server","My Mac Mini is my dev server, and one Claude Code session runs each project","2026-10-27",{"path":13,"title":14,"date":15},"\u002Fmax-out-claude-code-every-week","Max out Claude Code every week until I make 10K a month","2026-10-26",{"path":17,"title":18,"date":15},"\u002Fmaxing-out-claude-code-week-1","Maxing out Claude Code, week 1: a new blog, an app stuck in review and a full Mac Mini",{"path":20,"title":21,"date":22},"\u002Ffully-ai-coded-blog-claude-code","This blog is now fully AI coded and run by an agent I just talk to","2026-10-24",{"path":24,"title":25,"date":26},"\u002Fwhy-i-built-pepelly","Why I built Pepelly, a YouTube app for my daughter without the brain rot","2026-10-22",{"path":28,"title":29,"date":30},"\u002Fhow-i-built-an-equity-tracking-app-for-bootstrap-founders-in-a-weekend","How I Built an Equity Tracking App for Bootstrap Founders in a Weekend","2024-11-25",{"path":32,"title":33,"date":34},"\u002Fbuilding-directory-website-with-ai-in-a-day","How I Built a Directory Website in a Day with AI—and Why It's a Game-Changer for SaaS Traffic","2024-11-10",{"path":36,"title":37,"date":38},"\u002Fnetlify-build-plugin-for-nuxt-dynamic-routes","Use a netlify build plugin to generate your nuxt routes","2020-08-08",{"path":40,"title":41,"date":42},"\u002Foptimized-responsive-lazyloading-images-with-nuxt","How to use optimized, responsive and lazyloading images in a nuxt project","2019-11-16",{"path":44,"title":45,"date":46},"\u002Fnuxt-jam-stack","Building a SEO optimized blog with a Nuxt JAM stack and Markdown files","2019-11-07",{"path":48,"title":49,"date":46},"\u002Fprismjs-nuxtjs-static-pages","Getting Prismjs working with Nuxt",{"path":51,"title":52,"date":53},"\u002Fkeylogs-live-on-producthunt","My second launch this year: Keylogs is LIVE on Product Hunt today!","2018-02-12",{"path":55,"title":56,"date":57},"\u002Fa-new-year-and-a-new-startup","A new year and a new startup","2018-01-19",{"path":59,"title":60,"date":61},"\u002Fabout-mydash-whats-the-stack-and-why-did-i-choose-it","About myDash - What’s the stack and why did I choose it?","2017-10-16",{"path":63,"title":64,"date":65},"\u002Fsuper-fast-wordpress-hosting-germany","WordPress hosting test: super fast on raidboxes.eu","2016-12-09",{"path":67,"title":68,"date":69},"\u002Fbest-resources-for-stock-images","Best resources for stock images","2016-12-05",{"path":71,"title":72,"date":73},"\u002Fset-up-automatic-backups-for-parse-server-on-digital-ocean","Set up automatic backups for parse-server on digital ocean","2016-05-25",{"path":75,"title":76,"date":77},"\u002Fhow-to-run-parse-dashboard-alongside-parse-server-on-digital-ocean","How to setup parse-dashboard alongside parse-server on Digital Ocean","2016-05-18",19,{"id":80,"title":72,"body":81,"date":73,"description":655,"draft":656,"extension":657,"image":658,"meta":659,"navigation":660,"path":71,"projects":661,"readingTime":279,"seo":663,"stem":664,"tags":665,"updated":667,"__hash__":668},"posts\u002Fset-up-automatic-backups-for-parse-server-on-digital-ocean.md",{"type":82,"value":83,"toc":646},"minimark",[84,99,114,125,130,135,147,168,172,179,234,237,300,307,310,351,354,387,390,394,401,457,464,528,531,553,557,560,565,609,615,619,622,628,631,642],[85,86,87],"p",{},[88,89,90,91,98],"span",{},"Photo by ",[92,93,97],"a",{"href":94,"rel":95},"https:\u002F\u002Funsplash.com\u002F@markusspiske?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText",[96],"nofollow","Markus Spiske"," on Unsplash",[85,100,101,102,107,108,113],{},"If you run packtor-server on a ",[92,103,106],{"href":104,"rel":105},"https:\u002F\u002Fm.do.co\u002Fc\u002Ff5a70d4a6dbb",[96],"digital ocean droplet*",", chances are you followed the instructions from ",[92,109,112],{"href":110,"rel":111},"https:\u002F\u002Fwww.digitalocean.com\u002Fcommunity\u002Ftutorials\u002Fhow-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04",[96],"this tutorial"," setting everything up. This post is an addition and explains how to set up automatic backups for your MongoDB based on the users and server setups created when following the tutorial.",[115,116,117],"blockquote",{},[85,118,119,120],{},"If you also want to run parse-dashboard on your server, you might want to take a look at ",[92,121,124],{"href":122,"rel":123},"https:\u002F\u002Fderkinzi.de\u002Fhow-to-run-parse-dashboard-alongside-parse-server-on-digital-ocean\u002F",[96],"this post",[126,127,129],"h2",{"id":128},"setting-up-the-backups","Setting up the backups",[131,132,134],"h3",{"id":133},"make-a-folder-for-our-backups","Make a folder for our backups",[85,136,137,138,142,143,146],{},"The easiest way to backup your MongoDB is using the ",[139,140,141],"code",{},"mongodump"," command. But first let's make a folder for the backups in ",[139,144,145],{},"\u002Fvar\u002Fbackups\u002F",". For example like this:",[148,149,154],"pre",{"className":150,"code":151,"language":152,"meta":153,"style":153},"language-bash shiki shiki-themes derkinzi-tomorrow-night","mkdir \u002Fvar\u002Fbackups\u002Fmongobackups\u002F\n","bash","",[139,155,156],{"__ignoreMap":153},[88,157,160,164],{"class":158,"line":159},"line",1,[88,161,163],{"class":162},"sHQA9","mkdir",[88,165,167],{"class":166},"sRYIx"," \u002Fvar\u002Fbackups\u002Fmongobackups\u002F\n",[131,169,171],{"id":170},"try-backups-manually-first","Try backups manually first",[85,173,174,175,178],{},"Now we can try to backup our database manually. To get access to our database we can simply use the same user we used for transferring the data to our server. When you followed the above tutorial, this user is most likely calles ",[139,176,177],{},"parse",". So our command will look like this:",[148,180,182],{"className":150,"code":181,"language":152,"meta":153,"style":153},"sudo mongodump --port 27017 --ssl --db DATABASENAME --username USERNAME --password 'PASSWORD' --out \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\n",[139,183,184],{"__ignoreMap":153},[88,185,186,189,192,196,200,203,206,209,212,215,218,222,225,228,231],{"class":158,"line":159},[88,187,188],{"class":162},"sudo",[88,190,191],{"class":166}," mongodump",[88,193,195],{"class":194},"sJEhD"," --port",[88,197,199],{"class":198},"s8nuv"," 27017",[88,201,202],{"class":194}," --ssl",[88,204,205],{"class":194}," --db",[88,207,208],{"class":166}," DATABASENAME",[88,210,211],{"class":194}," --username",[88,213,214],{"class":166}," USERNAME",[88,216,217],{"class":194}," --password",[88,219,221],{"class":220},"s2jRq"," '",[88,223,224],{"class":166},"PASSWORD",[88,226,227],{"class":220},"'",[88,229,230],{"class":194}," --out",[88,232,233],{"class":166}," \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\n",[85,235,236],{},"Try running it. If it was successful, you will get something like this:",[148,238,240],{"className":150,"code":239,"language":152,"meta":153,"style":153},"2016-05-25T18:11:36.694+0200    writing DATABASE._User to \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002FDATABASE\u002F_User.bson\n2016-05-25T18:11:36.696+0200    writing DATABASE._User metadata to \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002FDATABASE\u002F_User.metadata.json\n2016-05-25T18:11:36.697+0200    done dumping DATABASE._User (20 documents)\n",[139,241,242,259,277],{"__ignoreMap":153},[88,243,244,247,250,253,256],{"class":158,"line":159},[88,245,246],{"class":162},"2016-05-25T18:11:36.694+0200",[88,248,249],{"class":166},"    writing",[88,251,252],{"class":166}," DATABASE._User",[88,254,255],{"class":166}," to",[88,257,258],{"class":166}," \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002FDATABASE\u002F_User.bson\n",[88,260,262,265,267,269,272,274],{"class":158,"line":261},2,[88,263,264],{"class":162},"2016-05-25T18:11:36.696+0200",[88,266,249],{"class":166},[88,268,252],{"class":166},[88,270,271],{"class":166}," metadata",[88,273,255],{"class":166},[88,275,276],{"class":166}," \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002FDATABASE\u002F_User.metadata.json\n",[88,278,280,283,286,289,291,294,297],{"class":158,"line":279},3,[88,281,282],{"class":162},"2016-05-25T18:11:36.697+0200",[88,284,285],{"class":166},"    done",[88,287,288],{"class":166}," dumping",[88,290,252],{"class":166},[88,292,293],{"class":220}," (20 ",[88,295,296],{"class":166},"documents",[88,298,299],{"class":220},")\n",[85,301,302,303,306],{},"You can also check the folder to see if the backup is there as expected ",[139,304,305],{},"cd \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002F",".",[85,308,309],{},"If everything looks good you can try restoring the backup (Maybe you shouldn't with a live app though). If you feel save restoring your backup try:",[148,311,313],{"className":150,"code":312,"language":152,"meta":153,"style":153},"sudo mongorestore --port 27017 --ssl --db DATABASE --username USERNAME --password 'PASSWORD' --drop \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002FDATABASENAME\n",[139,314,315],{"__ignoreMap":153},[88,316,317,319,322,324,326,328,330,333,335,337,339,341,343,345,348],{"class":158,"line":159},[88,318,188],{"class":162},[88,320,321],{"class":166}," mongorestore",[88,323,195],{"class":194},[88,325,199],{"class":198},[88,327,202],{"class":194},[88,329,205],{"class":194},[88,331,332],{"class":166}," DATABASE",[88,334,211],{"class":194},[88,336,214],{"class":166},[88,338,217],{"class":194},[88,340,221],{"class":220},[88,342,224],{"class":166},[88,344,227],{"class":220},[88,346,347],{"class":194}," --drop",[88,349,350],{"class":166}," \u002Fvar\u002Fbackups\u002Fmongobackups\u002FmyBackup\u002FDATABASENAME\n",[85,352,353],{},"When successful you will see something like this:",[148,355,357],{"className":150,"code":356,"language":152,"meta":153,"style":153},"2016-05-25T18:17:46.382+0200    finished restoring DATABASE._User (0 documents)\n2016-05-25T18:17:46.383+0200    done\n",[139,358,359,379],{"__ignoreMap":153},[88,360,361,364,367,370,372,375,377],{"class":158,"line":159},[88,362,363],{"class":162},"2016-05-25T18:17:46.382+0200",[88,365,366],{"class":166},"    finished",[88,368,369],{"class":166}," restoring",[88,371,252],{"class":166},[88,373,374],{"class":220}," (0 ",[88,376,296],{"class":166},[88,378,299],{"class":220},[88,380,381,384],{"class":158,"line":261},[88,382,383],{"class":162},"2016-05-25T18:17:46.383+0200",[88,385,386],{"class":166},"    done\n",[85,388,389],{},"Sweet! Now that we know everything works as it should, let's automate the process with a cronjob.",[131,391,393],{"id":392},"automate-backups-with-a-cronjob","Automate backups with a cronjob",[85,395,396,397,400],{},"Basically we could just put the above command in a cronjob and fire it every day - but wouldn't it be nice to have the backup in a folder with the date it was created? Yeah, right. So let's tweak the above command a little bit by adding ",[139,398,399],{},"date +\"\\%m-\\%d-\\%y\"",":",[148,402,404],{"className":150,"code":403,"language":152,"meta":153,"style":153},"sudo mongodump --port 27017 --ssl --db DATABASENAME --username USERNAME --password 'PASSWORD' --out \u002Fvar\u002Fbackups\u002Fmongobackups\u002F`date +\"%m-%d-%y\"`\n",[139,405,406],{"__ignoreMap":153},[88,407,408,410,412,414,416,418,420,422,424,426,428,430,432,434,436,439,442,445,448,451,454],{"class":158,"line":159},[88,409,188],{"class":162},[88,411,191],{"class":166},[88,413,195],{"class":194},[88,415,199],{"class":198},[88,417,202],{"class":194},[88,419,205],{"class":194},[88,421,208],{"class":166},[88,423,211],{"class":194},[88,425,214],{"class":166},[88,427,217],{"class":194},[88,429,221],{"class":220},[88,431,224],{"class":166},[88,433,227],{"class":220},[88,435,230],{"class":194},[88,437,438],{"class":166}," \u002Fvar\u002Fbackups\u002Fmongobackups\u002F",[88,440,441],{"class":220},"`",[88,443,444],{"class":162},"date",[88,446,447],{"class":166}," +",[88,449,450],{"class":220},"\"",[88,452,453],{"class":166},"%m-%d-%y",[88,455,456],{"class":220},"\"`\n",[85,458,459,460,463],{},"Try it out. If this command works for you it's time to set up our cronjob. Enter crontab by typing ",[139,461,462],{},"sudo crontab -e",". Then add the following line:",[148,465,467],{"className":150,"code":466,"language":152,"meta":153,"style":153},"5 3 * * * \u002Fusr\u002Fbin\u002Fmongodump --port 27017 --ssl --db DATABASE --username USERNAME --password 'PASSWORD' --out \u002Fvar\u002Fbackups\u002Fmongobackups\u002F`\u002Fbin\u002Fdate +\"\\%m-\\%d-\\%y\"`\n",[139,468,469],{"__ignoreMap":153},[88,470,471,474,477,481,483,485,488,490,492,494,496,498,500,502,504,506,508,510,512,514,516,519,521,523,526],{"class":158,"line":159},[88,472,473],{"class":162},"5",[88,475,476],{"class":198}," 3",[88,478,480],{"class":479},"sx7Ch"," *",[88,482,480],{"class":479},[88,484,480],{"class":479},[88,486,487],{"class":166}," \u002Fusr\u002Fbin\u002Fmongodump",[88,489,195],{"class":194},[88,491,199],{"class":198},[88,493,202],{"class":194},[88,495,205],{"class":194},[88,497,332],{"class":166},[88,499,211],{"class":194},[88,501,214],{"class":166},[88,503,217],{"class":194},[88,505,221],{"class":220},[88,507,224],{"class":166},[88,509,227],{"class":220},[88,511,230],{"class":194},[88,513,438],{"class":166},[88,515,441],{"class":220},[88,517,518],{"class":162},"\u002Fbin\u002Fdate",[88,520,447],{"class":166},[88,522,450],{"class":220},[88,524,525],{"class":166},"\\%m-\\%d-\\%y",[88,527,456],{"class":220},[85,529,530],{},"This job will run the task everyday at 3:05 am. Notice a few changes to the original command:",[532,533,534,542],"ol",{},[535,536,537,538,541],"li",{},"We have added absolut paths for every command. This makes sure the root crontab will find everything (you can find the paths by typing ",[139,539,540],{},"which mongodump"," for example)",[535,543,544,545,548,549,552],{},"We escaped the ",[139,546,547],{},"%"," symbol by adding a ",[139,550,551],{},"\\"," before it. Otherwise the cronjob will run into an error.",[131,554,556],{"id":555},"keep-backups-for-7-days","Keep backups for 7 days",[85,558,559],{},"Most likely you don't want to keep every single backup you'll ever make. A good rule of thumb is to keep backups of the last 7 days. (This will also make sure, the MongoDB backups will be backed up by the standard digital ocean server backup should you use it.)",[85,561,562,563,400],{},"We can achieve that by adding a cronjob that simply deletes backups that are older then seven days right before we create a new one. So simply add a new cronjob right before the above in ",[139,564,462],{},[148,566,568],{"className":150,"code":567,"language":152,"meta":153,"style":153},"3 3 * * * find \u002Fvar\u002Fbackups\u002Fmongobackups\u002F -mtime +7 -exec rm -rf {} \\;\n",[139,569,570],{"__ignoreMap":153},[88,571,572,575,577,579,581,583,586,588,591,594,597,600,603,606],{"class":158,"line":159},[88,573,574],{"class":162},"3",[88,576,476],{"class":198},[88,578,480],{"class":479},[88,580,480],{"class":479},[88,582,480],{"class":479},[88,584,585],{"class":166}," find",[88,587,438],{"class":166},[88,589,590],{"class":194}," -mtime",[88,592,593],{"class":166}," +7",[88,595,596],{"class":194}," -exec",[88,598,599],{"class":166}," rm",[88,601,602],{"class":194}," -rf",[88,604,605],{"class":166}," {}",[88,607,608],{"class":166}," \\;\n",[85,610,611,612,306],{},"This cronjob will run 2 minutes before a new backup is created and delete backups older than 7 days in ",[139,613,614],{},"\u002Fvar\u002Fbackups\u002Fmongobackups\u002F",[126,616,618],{"id":617},"done-further-ideas","Done & further ideas",[85,620,621],{},"That's it! We have now successfully set up automatic backups for our MongoDB for the last seven days.",[85,623,624,625,306],{},"If you want you can keep more or less backups. Also you could additionally keep monthly backups for the last 3 month or so. In this case I would make a new folder for them, add another (monthly) cronjob for backing up the database into it and alter the job for deleting old ones to ",[139,626,627],{},"+30",[85,629,630],{},"Also a nice idea would be to push the latest backup to dropbox or some other cloud space. But I'll save that for a future post...",[85,632,634,635,641],{"style":633},"font-size:10px;","Image by ",[92,636,640],{"href":637,"rel":638},"https:\u002F\u002Fwww.flickr.com\u002Fphotos\u002Fsmemon\u002F",[639],"_nofollow","Sean MacEntee"," on Flickr",[643,644,645],"style",{},"html pre.shiki code .sHQA9, html code.shiki .sHQA9{--shiki-default:#6196CC}html pre.shiki code .sRYIx, html code.shiki .sRYIx{--shiki-default:#7EC699}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sJEhD, html code.shiki .sJEhD{--shiki-default:#F8C555}html pre.shiki code .s8nuv, html code.shiki .s8nuv{--shiki-default:#F08D49}html pre.shiki code .s2jRq, html code.shiki .s2jRq{--shiki-default:#CCCCCC}html pre.shiki code .sx7Ch, html code.shiki .sx7Ch{--shiki-default:#E2777A}",{"title":153,"searchDepth":261,"depth":279,"links":647},[648,654],{"id":128,"depth":261,"text":129,"children":649},[650,651,652,653],{"id":133,"depth":279,"text":134},{"id":170,"depth":279,"text":171},{"id":392,"depth":279,"text":393},{"id":555,"depth":279,"text":556},{"id":617,"depth":261,"text":618},"How to set up automatic MongoDB backups for a parse-server running on a Digital Ocean droplet.",false,"md","\u002Fimg\u002Fbackup.jpg",{},true,[662],"packtor",{"title":72,"description":655},"set-up-automatic-backups-for-parse-server-on-digital-ocean",[666,177],"server",null,"JP7s502iGseoM4MsLDIClqHJvfM-QuJCAgEhPOSNaGU",[670,672],{"title":68,"path":67,"stem":671,"children":-1},"best-resources-for-stock-images",{"title":76,"path":75,"stem":673,"children":-1},"how-to-run-parse-dashboard-alongside-parse-server-on-digital-ocean",[675],{"id":662,"title":662},1793264868662]