Setting up daily backups

Hi guys. I was wondering if anyone here has setup automatic backups for their live applications. Normally on hosts with Cpanel, you have the options for daily or hourly backups of the entire site. Not sure how to do this with a Replit deployed site.

Now i am using Git to backup the website files, but i don’t think Git backs up your database right? Any tips would be appreciated

i have a backup service connected to google drive that runs nightly to backup selected tables from the db of a deployed CRM. Just ask agent :slight_smile:

Git alone won’t cover database backups.
On Replit, the code is versioned, but you’ll need a separate, automated process to dump and store your database (for example, a small scheduled script that exports the DB to external storage or get file downloaded). I’m not sure, is there an option to export db as CSV for easy backups.

1 Like

where does this run? In the same app, or do you have a 2nd app that does it?

Same app yes. Runs daily 11:59pm and posts an excel sheet to a dedicated shared folder

I am intrigued, how do you make the app run the backup code at a set time each day?

the backup system runs inside the same Node.js app that powers the CRM. It doesn’t require a separate server or service.

How It’s Built

1. Scheduled Task with node-cron
We used a library called node-cron that lets you schedule tasks to run at specific times - similar to how your phone can set alarms. Our backup runs daily at 11:59 PM Cairo time.

2. Excel File Generation
When triggered, the system exports all CRM data we’ve chosen into an excel file using the xlsx library.

3. Google Drive Upload
The file is automatically uploaded to Google Drive using Google’s API and are organized in folders by year and month: backups/2025/02/backup_filename.xlsx

Why It Works in the Same App

  • No separate process needed - The cron job runs in the background while the main app handles user requests

  • Shares the same database connection - Can directly query the same data users are working with

  • Lifecycle management - The scheduler starts when the app starts and stops when it stops.


It’s essentially an “always-on alarm clock” built into the app that wakes up once a day, packages the data, and sends it to the cloud.

Origin story of the feature :slight_smile:
The team wanted a backup button where someone would tap it at the end of each business day to manually backup the CRM. that person got sick for a couple of days and no one picked up the task. So I asked agent how can we get rid of the manual process and apply an automated backup service. Since implementing it, it’s been running like clockwork for 3 months now.

Isn’t the Neon and Replit in-house db backed up automatically at least daily? Do you do this process Is in case the Replit/Neon backups fail?

im honestly not aware of this feature on replit, and yes, we do this incase the there is some failure and in a worst case scenario, have all the data backed up and i can just whip up another app, build an import feature and start where we left off

1 Like