Closed (fixed)
Project:
Provision
Version:
6.x-0.1-rc1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jun 2008 at 15:22 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
anarcat commentedI don't think I understand what you mean here. What are the steps necessary to recreate the bug? What behavior were you expecting?
I guess you mean that we can't rename a site, but I wouldn't expect that as a feature just yet.
Comment #2
adrian commentedYou can now however alias sites.
Comment #3
adrian commentedI added a 'deploy' command, which allows you to deploy a backup of a site under a new url.
it also handles the files directory changes.
there's no 'rename' command per se tho, but i imagine it will be a slight differentiation on the existing 'migrate' command
Comment #4
anarcat commentedComment #5
anarcat commentedWe are going to have problems with uploaded files when renaming (or cloning) sites. Maybe we need to abstract that away right now?
Should we have a rewrite rule like this?
That would save us a lot of trouble... I'm not sure, however, that Drupal can handle a different frontend and backend path...
Comment #6
anarcat commentedThe files issue is a separate one: #275022: When moving or aliasing sites, permanently redirect sites/somesite.com/files to sites/$site_url/files..
The only thing missing here is probably a "rename" command that wraps around all this stuff (backup + deploy, whereas deploy fixes files urls).
Comment #7
univate commentedOne of the things I have tried in the past (which works) is use a generic name under my sites folder and then use a symbolic links for domain paths. That would allow you to have the same site deployed across multiple platforms under different domains (e.g. dev/staging/productions) but always keep the file paths the same. The idea is that the site name would be unique in aegir and every platform that had a site folder with that specific unique name could be linked back to the one site object in aegir. That would force every site to have a name that should never change, but you could change the domains easily.
Is that something that could be explored here:
e.g.
When you looked in aegir at the site "example" it would show versions of itself under each platform.
1. Platform 1 at the url - example.com
2. Platform 2 at the url - staging.example.com
The settings.php should also be updated to always use the file path:
sites/{site_name}/files (rather then the current domain name)
This also has a side effect of often smaller/cleaner urls for file paths (particularly subdomains):
e.g.
http://staging.example.com/sites/example/files/download.pdf
instead of
http://staging.example.com/sites/staging.example.com/files/download.pdf
Comment #8
anarcat commentedsee that's already a problem: what happens when you migrate to a platform where that name already exists?
i think we should stick with the unique name (the domain name) for storage. we can update the body and the files table on deploy, the only issue is the external links.
let's take the files issue to #275022: When moving or aliasing sites, permanently redirect sites/somesite.com/files to sites/$site_url/files. (since they also apply to clone) and keep this related to the actual rename stuff.
Comment #9
univate commentedFirst off I should define the terms I am using:
The idea here is that "site name" would have to be unique (aegir would need to check that it is a unique name before creating or importing a sites, just like it checks that the domain name is unique).
If you are trying to migrate a website to a platform where the site name already exists it wouldn't be a migration it would be a replacement. As the existence of the same named website would mean it is the same site (just a different versions of the site e.g. testing/production). The only way you would get another version of a site under a different platform would be via a 'clone' operation, creating or importing sites would not allow this to happen. Clone could then provide two outcomes:
Replacement is a perfectly valid operation, as there are cases where you want to test out features, show them to a client on a non live version of their website and then when they approve the change migrate (replace) the website for real.
What you get with this solution:
Also this site name doesn't have to be something the users creates themselves, it could easily be created by aegir, e.g. it could just be a node_id
I don't see a lot of reasons to having the same website running on the same platform, normally when you are testing out new features they are related to code changes and therefore a new platform.
Comment #10
anarcat commentedSo I *think* I agree with you, but what you are really talking about here is clone, not rename, so see #448692: site clone support for that. I will answer in that other issue.
Comment #11
Anonymous (not verified) commentedI've written an early Rename feature/task. Seems to work, needs some work still, but early reviews welcome.
Branches on my git.mig5.net (git clone git://git.mig5.net/drupal/{profiles/hostmaster , modules/provision}
275737_site_rename
Hostmaster diff
Provision diff
Comment #12
adrian commentedThis shouldn't delete the node and recreate it on the front end.
it should just set the $node->title of the node.
Comment #13
Anonymous (not verified) commentedPlease test the new 275737_site_rename branch via git://git.mig5.net/drupal/{profiles/hostmaster,modules/provision} . Node->title is simple updated, no silly destroying of old and creating new.
Also attached are basic patches for review.
Comment #14
Anonymous (not verified) commentedUh, updated Provision patch, I forgot to apply a stash that contained fixes for hyphenated drush commands..
Comment #15
Anonymous (not verified) commentedI've moved these branches to git.aegirproject.org as dev branches 'dev-site_rename' in both provision and hostmaster.
Comment #16
Anonymous (not verified) commentedIf $node->revision = TRUE, hosting_site_update() switches to hosting_site_insert() as it assumes a new node or a new revision. Is this actually deliberate in the case of where a node is NOT new, but a revision is being made?
The problem I have with Site Rename is that I set $node->revision = TRUE to make an entry in node_revisions that the $node->title has changed. But what happens is I end up getting a duplicate row in hosting_site (well, with the new vid). This isn't good because there are a number of queries that are made against hosting_site on the value of $nid, which are identical in cases like this, and not $vid.
I can set no revision, and then all is well, but then I lose the history of the change in node_revisions which is also not desirable.
So what do we do?
1) Set no revision when renaming the site and then the database integrity is clean
2) Set a revision, but go through all the Hosting code and update SELECT queries that are made against hosting_site to be based on the vid or something?
Perhaps we can set a conditional in hosting_site_update() to check for not just $node->revision but also $task_type != 'site_rename' but I don't think the $task is available at that time.
or 3) We don't tell hosting_site_update to check for $node->revision but something else that *only* can occur when a node is new and not just getting a revision (Does such a check exist? I think at that point the $node->nid already exists)
Thoughts?
Comment #17
Anonymous (not verified) commentedAfter various discussions I committed the current working version to the master branch. We currently do not save a revision of the site node when changing its title. When we refactor various parts of Hosting to select from tables like hosting_site by vid rather than nid, we can fix this. But that refactoring needs to be a separate issue, as it affects a large number of things such as batch migrate and more.