Open peaklabs-dev opened 5 months ago
/attempt #2389
with your implementation plan/claim #2389
in the PR body to claim the bountyThank you for contributing to coollabsio/coolify!
Add a bounty β’ Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
π’ @peaklabs-dev | Aug 5, 2024, 10:24:26 AM | #2999 |
putting a bounty on this to make it high-priority
UI coolify_domain.you/settings#backup
Related files
https://github.com/coollabsio/coolify/blob/main/app/Jobs/DatabaseBackupJob.php#L30
https://github.com/coollabsio/coolify/blob/main/app/Jobs/DatabaseBackupStatusJob.php#L18
Related blade files
UI coolify_domain.you/settings#backup
Related files
https://github.com/coollabsio/coolify/blob/main/app/Jobs/DatabaseBackupJob.php#L30
https://github.com/coollabsio/coolify/blob/main/app/Jobs/DatabaseBackupStatusJob.php#L18
Related blade files
hi, currently coolify only supports backups for the database. instead this issue/feature request is to backup more than database
If this will be completed, please allow options to choose drives on a server to backup to, not just S3
@m1daz What do you mean with drives? A local folder path, I assume?
Yes, not on S3
Would it make sense to allow a one click restore option? If you back up your volume data from any docker app for instance, clicking "restore" would replace the current volume with the one of the backup.
Another great option would be creating a new "resource" out of a backup. I don't know if you're familiar with Hetzner backups, but if you backup your machine, you could click "create a new machine from backup". That would spin up a new VM with the data of you backup. The exact same mechanism would come in handy with resources as well. Backup -> Create a new resource from backup -> New resource is created (with different domain and or ports)
I think it's important to have a clear goal here; is it also the goal to back up the volumes? If so, that can be a lot of data.
I think it's important to have a clear goal here; is it also the goal to back up the volumes? If so, that can be a lot of data.
Indeed I'd say it is important. For stateless applications such as NextJS and Astro where you probably send your files to S3 anyways, it's not important. However for the wordpress folks where some data such as images is located outside of the database this feature would be very beneficial.
How would you determine per application what to backup? Only local volumes, persistent docker volumes etc?
@Thijmen @w7tf The goal is just to refactor and improve the current backup flow and add missing features. Database restore should be available for all databases, one click restore (no manual download and upload of the backup file). Almost all docker containers have volumes that are persistent and these need to be backed up which is the point of a backup, as the container is not persistent but the volumes are. and also some other enhancements life SFTP storage option not just s3.
@w7tf I added your idea as pint 17 to the feature request: https://github.com/coollabsio/coolify/issues/2389#issue-2341711069 @Thijmen
How would you determine per application what to backup? Only local volumes, persistent docker volumes etc?
There would be two checkboxes: Backup Database, Backup Container --> The backup container will backup all persistent data of the container (volumes). Updated my request for more accuracy: https://github.com/coollabsio/coolify/issues/2389#issue-2341711069
SFTP would be very easy, as Laravel supports that out of the box with Flysystem; https://flysystem.thephpleague.com/docs/
SFTP would be very easy, as Laravel supports that out of the box with Flysystem; https://flysystem.thephpleague.com/docs/
I see SFTP and WebDAV and some more is supported by this that is amazing.
@Thijmen If you have time to implement it, I would be more than happy to test it and make suggestions.
How would you determine per application what to backup? Only local volumes, persistent docker volumes etc?
The things I would 100% want backed up are my postgres resource storage and a storage volume for another nodejs project. I also can't stress this enough, but I would really like local backups on specific drive mounts or folders on those drives, etc (since I have 8 different disks), not just remote ones. Coolify can be used for managing local servers too, not just cloud ones.
Great job! What about resource-level backups? Being able to restore an application/resource individually.
Ideally speaking I would love to see a backup/restore strategy similar to that of Plesk - a cPanel like control panel for hosting websites.
In Plesk you are able to backup the server configs, and separate subscriptions (domains and their subdomains) including the DB and the files.
Thing with Coolify is I think it was meant to be just for hosting the SPA and cold start applications which don't store much info other then DB perhaps and use S3 for block storage.
As you have docker containers and people can host projects such as WordPress, there needs to be a way to create three different backups per project:
Config backup is covered by the Coolify DB backups; project DB backup is covered by the additional DBs - which can be added in Coolify backup settings, albeit you must add each DB manually. This means that we only need to find a way to create a volume/storage backups.
Also, restore strategy needs consideration. With Plesk for instance, you can initialise a basic instance of Plesk and configure it enough to connect to S3 storage, then just pull the latest backup; or if you need to restore only one project, then just select that one project for restore.
I think right now the best work around is to find a PaaS that provides ability to create instance snapshots/backups of the VPS, which most thankfully do, but for extra charge, or segregate your projects to different servers. Those that need dedicated backup strategy go to server X and those don't need it go to Y.
As I have some time and have a quite a full understanding on what all is needed I will work on this /attempt #2389
I think this should be broken down into smaller tasks that can then be progressively merged into core.
I'd particularly love to see encryption for database backups, would be nice for that land without having to wait for the other features.
Mostly interested in adding an option to backup volumes for applications that use volumes to upload data
I would love to put a bounty on this if it would actually mean it being done faster, but I don't feel like it's the case with the already present generous bounty.
@Paillat-dev I will work on this. At the moment we are focused on releasing v4 stabel and fixing the last bugs and some perfomance enhancements.
@peaklabs-dev Happy to hear that. Thanks to you all contributory for this truly amazing project !
Love Coolify so far, I am considering it for a production scenario, but it would need some more backup/restore features for this to be a safe and viable option. So backups for databases, volumes/mounts, everything that changes basically. More widely supported targets/methods (like (S)FTP, SCP) would also have my preference over S3.
So following this thread with great interest :)
I'm looking to use coolify for a homelab server and i would love to see the support for rclone (https://rclone.org/). He is providing a large variety of storage and this will be very cool for people with low budget.
like wowtah (backup => SFTP )
Adding my support for encryption on backups - the whole point of self-hosted is being in control of your data, pushing unencrypted data to an S3 store in the cloud can be dangerous for many reasons.
General Idea
Currently only databases are backed up. Also, only some databases have a restore option. See: https://github.com/coollabsio/coolify/issues/2501. Streamline database backups and offer a one click restore option without having to manually download and upload the backup. Also there should be a second checkbox that allows us to set container backups -> a container backup is just a backup of all the persistent data (volumes) of the container.
Detailed Description
I think it should be pretty straightforward for the pro @andrasbacsai. I thought about all the points and how I would implement it below, hope it helps (can not implement it myself for now as I am not experienced enough with Larvel):
delete old Backups with
find
ssh "${remote_target}" "find ${remote_dir} -type f -name '*-backup.tar.gz' -mtime +$keep_backups -exec rm {} \;"
-> At the Coolify level, we can select Backup All --> and with Backup All, it basically just backs up all the volumes in the Docker volumes directory.
Manual script as a demo (source: https://schroederdennis.de/docker/docker-volume-backup-script-sichern-mit-secure-copy-scp-nas/)