Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to update site domain and name #878

Closed
yunti opened this issue Nov 3, 2016 · 4 comments
Closed

Best way to update site domain and name #878

yunti opened this issue Nov 3, 2016 · 4 comments

Comments

@yunti
Copy link
Contributor

yunti commented Nov 3, 2016

I didn't know the project site domain when first starting the project, which has now changed from that initially specified. These seem to be set within contrib-site migration. What's the best way to update these? Manually with a new migration?

@jayfk
Copy link
Collaborator

jayfk commented Nov 3, 2016

Exactly. Or you revert the first migration, edit it manually, and then run the migration again.

@yunti
Copy link
Contributor Author

yunti commented Nov 3, 2016

Perfect thanks.

@yunti yunti closed this as completed Nov 3, 2016
@art3mHQ
Copy link

art3mHQ commented Aug 19, 2023

can you please share how to do it exactly?

@Yusuf-shaik
Copy link

Yusuf-shaik commented Aug 3, 2024

can you please share how to do it exactly?

I know this is from a year ago but i'll answer it for anyone else that comes across this in the future. So migration 0003 is what sets your domain name, you need to revert to an older migration, make the code changes, then run the migrations again.

  • On your server, run docker-compose -f production.yml run --rm django python manage.py migrate sites 0002 which will revert your migration status to 0002
  • Run run docker-compose -f production.yml run --rm django python manage.py showmigrations sites to confirm that only the first 2 migrations are set, you will see checkboxes
  • Then make the code changes in the migration file and anywhere else you need to, and run docker-compose -f production.yml build && docker-compose -f production.yml run --rm django python manage.py migrate && docker-compose -f production.yml up which will build, migrate the changes with your new domain name, and run your site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants