Backup db and images

I have a site in php on shared hosting server with mysql database, which lists the records of products with associates for each record about thirty images (saved in a server folder)
Each record has a field to determine if it is visible in the front end.
Since the site administrator never erases obsolete records, now we have a complicated situation to say the least.
The site views from time to time about thirty visible records, but the database contains a list of records of more than six years, with over 200,000 images, (with the provider complaining about this situation)
I have asked several times to eliminate obsolete Recors, but in vain

At this point the ideal would be to be able to archive a backup with the data of the last five years (eliminating the previous ones) on an subdomain or on local PC, and keep only visible records in the database.
In this case, periodically the system should update the backup

I hope I have exposed my problem clearly enough
Any suggestions?

Hello!

In this case what I would do, would be to use filezilla and save all the photos to a disk.
Then if the photos are linked in a database with the upload date, I would make a copy of the table as well.
After having done all the backup, I would do a repeat with a file delete from the table where the date of the file is greater than 5 years

Something like that

I’m really wondering, is your customer paying you to engineer such solution? :laughing:

My suggestions:

  1. Pay more for the hosting (or change hosting provider) to allow more images to be hosted (easiest option)
  2. Move images to S3 and let the customer pay the extra bill (also you need to change the existing website to use S3 instead of folders… more difficult option)

For backing up the database I like using DBeaver Community Edition, but it’s a manual process, not sure if there’s automation. For backing up files @ franse mentioned FileZilla. For MacOS I use Transmit (it’s a paid app), but you can also use FileZilla