-
-
Notifications
You must be signed in to change notification settings - Fork 393
feat: Add site cloning functionality #560
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
Conversation
- Add CloneSite action for handling site duplication logic - Implement site duplication UI in site view page - Add duplicate-site nginx script - Add feature tests for site duplication
…created when creating a site, and it just needs to be updates)
|
I think would be good to have an option for isolated users. Currently this PR clones the site under the same user as the cloned site which might not be the use case for isolated users. The idea of isolated users is to have one user per site. |
|
I added the option to enter username if wanted. |
|
@dyanakiev why didn't use the existing Action (CreateSite) and created a new Action? I would go with re-using the existing code than duplicating it |
|
Also by cloning I thought we will create a new site with the same configs not literally copying the existing site. by copying it will also get some unwanted files like stuff in the storage and envs and etc |
Thats the idea, to clone all existing files as well. Could be used for wordpress staging sites or similar situations. |
|
Can't we make it an option? I see use cases for both. But also a fresh copy, as Saeed suggest, to have a clean start, without storage. |
|
Looks a bit complex now. offering this feature might be useful for WP sites but maybe not Laravel sites due to env, storage folder, cache and ... |
|
Just wanted to chime in because this functionality would be useful for me (a new WordPress page would be copied from a "template" page). |
|
Yes the use case for wordpress is much simpler. |
|
I think copying the entire folder and its contents is fine even for Laravel applications including the .env, if anyone wants can always delete the files he needs. Maybe i can add "advanced" settings where there will be choice to skip certain files or folders. |
|
After looking into it a bit more.... |
|
@saeedvaziry can we add this feature to the v3 roadmap, but with your suggestions - meaning it's more focused on the Laravel usecase where we do not clone all the site files, but rather clone the setup in an isolatation fashion? |
|
We believe this feature is especially effective for WordPress-based projects, where quickly replicating environments can significantly speed up development and testing. |
|
Closing as outdated |
Site Duplication Feature
Description
This PR adds the ability to duplicate existing sites within the same server. Users can create exact copies of sites with new domains and optionally different branches, making it easier to create staging/testing environments or replicate site configurations.
Features
DuplicateSiteaction for handling site duplication logicAPI Changes
Added new endpoint for site duplication:
Duplicate Site
POST /api/projects/{project}/servers/{server}/sites/{site}/duplicateAuthentication
Request Parameters
Example Request
{ "domain": "staging.example.com", "aliases": ["www.staging.example.com"], "branch": "develop" }