I updated to Local 2.4.3 and then updated a site’s environment. All my sites use the ‘custom’ environment option. The result of the upgrade was a duplicate folder called ‘site-name-clone’ and host file entry for site-name-clone.local. I’ve tested and it seems to work fine. What are the recommended steps for removing the original environment and renaming the clone so that everything is back to ~/Local Sites/site-name and site-name.local and so forth.
I don’t call this “best practice”, but I’ve gone through this process.
What I did was:
- Update environment (which makes a clone with the “-clone” suffix)
- Export your original site using the “Export” option when right clicking the site’s name (so you can keep it safe in case of something wrong happening)
- Delete the original site that was just exported (the export holds a complete backup of the site, so it can be imported back at any moment)
- Rename the site (to delete the “-clone” suffix)
- Change site domain (to delete the “-clone” suffix)
After all those changes, your site will be working just like the one before, but your folder inside “Local Sites” will still have the “-clone” suffix. To solve this the best way is to Export this cloned site the same way you did with the original one, delete the site you exported after the process is done, and import it again with the correct name, that way your folder will have the same name.
Ex:
Original folder name - localbyflywheel
Cloned folder name - localbyflywheel-clone
Cloned folder name after import (you can name it any way you want) - localbyflywheel
That way you will have the same domain, site name, and folder name as before, but with the environment upgraded.
There might even be a better way to do it, but since I did it in kind of a hurry, I didn’t put much thought into it. If you improve this process in any way, please share! I would like to know a better way to do it.
Also if you have any questions about this process I gave, don’t hesitate to ask. And remember to always be sure to make backups/exports since you are deleting the websites, so be sure to not lose your work.
Thank you, atempel, for this workflow. It worked for me, and bonus: Git doesn’t even know anything happened.
Next, I tried one without the clone, which seems fine so far. I wish the message about the “modified site container” were clearer. Have I modified the site container? How does one modify the site container? If I don’t know the answers to these questions, is it unlikely that I’ve modified the site container? Clay says, in another post,
“Modified Site Container” in this case means going into the container and running commands to install packages (
apt
), change around core files, etc.”
I suspect that most of us who are just using the Custom Environment without “going into the container” can skip the clone altogether.
Feature Request: It would be great if this series of steps were automated. So you click “Update Environment” and it makes the clone with a CTA at the top “Test the new environment to ensure it works” with a button for “Yup! Passed all tests.” And then a new CTA for “Remove the old environment and rename this one.” with a button “Do it!” that runs all those steps.
Helpppp ! I update environment, so I have the clone
but nothing… runs
My original site don’t start (it say’s starting for… a very long time) and I can’t export because the option is grey
clone starts but I have a 502 error
thank you everyone for a quick answer
So nice it worked for you Lisa!
The export works almost as a copy/paste as far as I know, so no problem with git, indeed!
For the “Modified Site Container”… The Custom Environment is for you to be able to configure everything more freely and have full access to the container, so for some cases, mine included, tinkering with the container is needed. I have a modified my sites container installing some applications to run with the server, like git.
It’s not needed for every user, but some of us do. For short, If you don’t know what is a “modified container” you probably didn’t modified it haha.
@ColinD https://local.getflywheel.com/community/c/feature-requests
@Nirinarm this could be probably something more complex, I recommend you open a new topic with your problem described in detail (what you did, what happened, etc) and a log from Local (How do I retrieve Local's log file?)
So we all can help you
Thank you for your answer. I’m sorry, I’m French and so new (I decided to do my first site)
I’m a little bit lost and don’t really know how to open a new topic
The log file… is very long ! could I paste all or only since I did the update ?
thanks for your help
@Nirinarm you can create a new topic by clicking this button on the image below, in the forums homepage:
The file, even being long, you will be able to attach it to the topic, no need to paste it as text, just send the file
@atempel You’re so kind, I created the new topic, I need to return to it (if I find it again to send the file and perhaps explain more
oh lala
Renaming Sites after Environment Update also offers advice of this issue.