cancel
Showing results for 
Search instead for 
Did you mean: 

How to backup to cloud like S3, Dropbox or Drive?

How to backup to cloud like S3, Dropbox or Drive?

Not sure if this is the right board, but here it goes... How would you backup the whole installation of Magento 2 into cloud service like S3, Dropbox or Drive? It would need to be done regularly and also the automatic deleting of old backups from the cloud and server should be handled.

 

Is there some script available somewhere or is there any extension for this?

9 REPLIES 9

Re: How to backup to cloud like S3, Dropbox or Drive?

Hello @kuono 

 

I think you don't need to do backup of whole data, you can just setup code in git repository and schedule a daily basis of Database back for which your server provider may help.

Make sure you follow the correct git init approach.

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: How to backup to cloud like S3, Dropbox or Drive?

@gaurav_harsh1 Git might work for the code base, but client wants to have a separate off site backup for ALL data (DB, media, code etc.). Hosting provider is not able to provide off site backup services. Their backups are located on the same server hall and client want's backups to be physically at another place.

Re: How to backup to cloud like S3, Dropbox or Drive?

I've had good experience in the past using rclone on linux but that depends if you have SSH access to your hosting provider or not?

 

https://rclone.org/

 

If your on a shared hosting platform you might need to get a bit more creative and configure a daily download via FTP.

--
Problem solved? Click Accept as Solution!

Re: How to backup to cloud like S3, Dropbox or Drive?

@astue Thank you for the suggestion. We do have SSH access. I will look into rclone.

Re: How to backup to cloud like S3, Dropbox or Drive?

You can write a simple bash script (or have your hosting provider do it) that will automatically compress your files and dump your database, then transfer it to an offsite backup service. 

 

If you use S3, the bash script will need to use AWS CLI to transfer the backed up files and if you use an offsite backup storage service, the backup script can incorporate utilities like Rsync, Duplicity or even Borg to transfer the backup files. 

Re: How to backup to cloud like S3, Dropbox or Drive?

Maybe use another cloud storage? Or just download all the data and upload it back after installation. There are powerful free cloud storage websites that would be a nice option for this transition. It might be even faster because some allow uploading from other cloud services. This way, the upload speed will be way higher than from your PC. It will save you a lot of time, and you will be able to process the installation process faster. But I would not do backup at all because it’s a rather safe procedure, and I think nothing would happen to files in the cloud because of it.

Re: How to backup to cloud like S3, Dropbox or Drive?

Hello,

 

Here's the devdoc on how to do backups:

 

https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/backup.html...

 

a) you should always have your code in git

b) you should take full backups (both code and db)

c) these backups will populate into the application var/backups directory 

d) you could then rsync/scp/sftp them to your external storage

e) make sure this is very secure as a lot of sensitive data will be in the database backups

f) have a process properly validate the files arrived on the other side correctly (compare md5sums)

g) you can then delete the copy local to your magento in the backups folder

h) you may need to determine a pruning policy on the other side (how many backups to keep)

 

Finally, i don't belive this will backup the ~/var/ folder or the ~/pub/ folder.

 

You should test this in your staging/development environments thoroughly. 

Re: How to backup to cloud like S3, Dropbox or Drive?

Not the exact answer you are looking for, but it may help others:

For those using AWS hosting, you can AMI image or take a snapshot with a retention policy. There are also tools to create copies of images to different regions or zones. 

 

For example, we have automated backup policy take an image each day, and create a mirror copy to another zone. We have a 14 day rolling retention policy. After 14 days the oldest image is deleted. 

 

Re: How to backup to cloud like S3, Dropbox or Drive?


@kuono wrote:

Not sure if this is the right board, but here it goes... How would you backup the whole installation of Magento 2 into cloud service like S3, Dropbox or Drive? It would need to be done regularly and also the automatic deleting of old backups from the cloud and server should be handled.

 

Is there some script available somewhere or is there any extension for this?


Select the cloud storage service that best suits your needs. Popular options include Amazon S3, Dropbox, and Google Drive. Sign up for an account if you don't already have one. Install the corresponding desktop or mobile application for the cloud storage service you selected. These apps will allow you to easily upload and manage your files. Once the app is installed, you'll need to configure the sync settings. This typically involves selecting folders or files of proton saga where you want to back up to the cloud. You can choose specific directories or let the app sync your entire file system. After configuring the sync settings, you can start uploading files to the cloud. Depending on the service, you may have options to manually upload files or have the app automatically sync files in real-time or at scheduled intervals.