Page 1 of 1

SOLVED: Best practice: Archive old orders from database

Posted: Thu Nov 12, 2020 7:30 pm
by Rainforest
I'm wondering what is the best practice to lighten up the database, particularly the order table.
I've got about 6 years of orders and would like to lighten it up by only keeping the last 3 years and archiving the rest.

I know first and foremost download a back up copy and store it safely.
But should I just then, delete previous orders rows in phpmyadmin and that it? or is there a better method?


Thanks

Re: Best practice: Archive old orders from database

Posted: Thu Nov 12, 2020 7:50 pm
by IP_CAM

Re: Best practice: Archive old orders from database

Posted: Thu Nov 12, 2020 9:08 pm
by Rainforest
Thank you!
I'll check those out

Re: SOLVED: Best practice: Archive old orders from database

Posted: Sun Nov 15, 2020 7:10 pm
by Rainforest
For anyone that searches the forum,
I ended up doing the following:

1. Backup my database
2. Went into phpmyadmin
3. ran the following sql command :
DELETE from `order` where date_added < '2018-01-01'

This deleted orders older from January 1 2018.

Re: SOLVED: Best practice: Archive old orders from database

Posted: Sun Nov 15, 2020 8:13 pm
by OSWorX
Exporting (backup) old entries and deleting them is not really what you have written: archive.
Such would be for me to move older entries to an extra table and to be able to call old(er) entries when I need them.

You only are deleting them, but have to reimport them again when you need some ..
Completely different!