5👍
Here’s what I’d do:
- dump my data into a file see dumpdata
- stop the server
- remove all
.pyc
files - copy paste the whole folder of the website to the destination server
- restore data using loaddata
- run the server
I did this 4 times without any problems (dev to test environment, test to pre-prod and pre-prod to prod).
1👍
The reply by Oliver is good for small sites, but big companies (or any) won’t be happy if you stop the server, also some records/sales might be done between the time you dump and the time you stop the server
I think this would be better but I’m unsure:
-
make a new database and make it sync with the old one, whenever old db changes changes should be synced to the new db (I know for example postgres has a feature that triggers some kind of alerts on creations/updates, this is indeed the hardest step and needs quite a lot of research to pull it off, both databases must be on sync)
-
upload the new(copy) page next to the new database connected to it
-
modify the DNS records to point to the new server, traffic will organically move to the new server, at some point you might have people making database updates on both servers so it is important that the sync goes both ways
-
take the first web-page’s server down, cut the database syncing and remove old
page and old database - remove the pipe/method that was letting you sync the
new db with the old one
- [Django]-Good ways to import data into Django
- [Django]-Implementing Name Synchronization and Money Transfers in Transactions Model with Account Number Input
- [Django]-How to choose specific columns when using depth in serializer
- [Django]-Disadvantages of sharing Django sessions on multiple subdomains
- [Django]-How to run django app binded with gunicorn?