Okay, so I've searched everywhere and while I can find plenty of stuff about moving a Drupal install out of a subdirectory I can't find anything on moving one into a subdirectory. I've recently taken over this project and it was developed without me so I've been landed in it here.
The problem is that the site was developed in the root of a dev server and I now have someone who wants it in a subdir. I've changed the base url in the htaccess and I've tried manually changing references in the CSS and DB but I can't be sure I've caught everything (modules etc).
What I want to know is, is there a way to force every link relative to the root to be relative to root/example instead. Basically everything that was once at www.example.com is now at www.example.com/subdirectory.
Thanks.
There's two pieces to this. The first you've already done: configuring htaccess to set a base url that includes the subdirectory.
Unfortunately, you may have quite a few references in the node content (especially embedded images) that will stop working.
A relatively simple solution to this would be to include a <base href="foo.com/dir" /> tag in your site theme, but this isn't a great fix in the long term.
You can try modifying your database directly, through queries such as the following (use with care, backup your database ahead of time, etc):
UPDATE field_revision_body SET body_value = REPLACE(body_value, 'devdomain.com', 'proddomain.com/subdir') (add http:// into those queries)
You may also need to update the paths in your files table to reflect the new locations on disk, especially if you're using multisite.
Alternately, have you considered using the Backup & Migrate module to move content from the dev server to a new install at the new instance?
Related
I built a site for a client on my subdomain. I then transferred it accross - files and data base - to a new server.
Problem is base url no longer works.
I manually set it, eg:
<base href="http://www.website.com/">
But this seems to make all links open in new tabs.
Is there any way I can fix this via the database or config file?
After moving a MODX site to another server, domain or subdomain, you need to check the following places and take actions:
clear the site cache (!)
check via FTP if cache folder is really empty
if not -> set permissions, ask your hoster if 777 or 755
edit templates to contain new base href
check your .htaccess if you have old rewrite rules set
check core/config for old paths or urls
also check config.inc.php inside root folder, inside /manager/ and inside /connectors/.
Most of the paths and urls in Modx are based off of the site-wide settings. There are probably several that you would have to adjust. core_path is the most basic of these.
These can be found under the gear in the top right corner of the manager, under 'system settings'
Also, if this and the config file are not enough alone, this SO question suggests re-installing the setup folder and re-running the initial setup.
Move modx site from subfolder to root folder
I have 2 magento files in one server(linux) , one is live and other one is for testing. Both have different url. The testing magento is just setup by coping the live files and database. But I found out the testing magento will effect the live magento (for example I plugin the new template into testing magento , the live magento css and desgin will run also). Any idea about it?
Make sure that you have updated the URL in all of the config files AND the database. The easiest way to do this is to dump the database of the new site, find and replace the url of the original install with the new one then re-import it.
If you've been consistent with not hard coding links or images in CMS pages then the URL should only appear in these places:
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/update_site_url_in_core_config_data
You should use one magento on one server. Just create multiple stores in one. and redirect each store you what you want. www.example.com -> store 1; www.example1.com -> store 2 and so on. Magento works faster if you do that way. i have experience with multiple magento on one server. after more people start to use your store then server will start to lag or magento will start to work a lot slower.
this is happening because you have copied the database and files due to which in local.xml and in database table core_config there is information related to your live files, instead you should setup again the TESTING copy, just follow this steps.
take the backup of file local.xml from location /app/etc and after backup delete this file
Now after doing that just access the testing domain, now your setup for testing copy will start.
this will create new configuration information for testing copy
Had started my typical EE build (using a bootstrapped config) for a client when they announced they wanted another additional site using the MSM module (le sigh).
So added the MSM module, I commented out the $config['site_url'] and $config['cp_url'] and set those in index.php instead using $assign_to_config.
That's when I discovered this bug where MSM config file settings are not recognized, which is a pain but I can work around it. However, I noticed that when I created the secondary site, it wouldn't recognise my custom location for add-ons and so I had to add that to index.php as well to $assign_to_config['third_party_path'] = "../assets/third_party/";.
Then I discovered that when I create or modify a template file, it won't automatically sync and so I need to manually do that each time which is a real PITA.
Why would my templates not be syncing to the database? Is this related to the MSM config bug?
While I haven't tried bootstrapping the third party path yet, I've definitely been able to bootstrap the template path for MSM sites... What bootstrap method are you using?
Are your sites on subdomains or subfolders? I've only had experience with subfolders so perhaps that makes a difference (although it shouldn't).
Could you maybe walk through in a bit more detail what's happening? Your first site (site_id = 1) templates sync automatically from filesystem edits, but your second site does not? Yet if you go to CP > Design > Synchronize Templates, that works?
The $assign_to_config portion of MSM setup is definitely a weakspot when it comes to bootstrapping... I wonder if we need to work up an additional bootstrap for MSM+CP environment, where it looks at the cp cookie ($_COOKIE['exp_cp_last_site_id']), and sets values based on that.
It may be helpful if you let us know which bootstrap you are using. For example, if you look at this bootstrap the site_url and cp_url are set using the HTTP_HOST server variable, so this shouldn't clash with your MSM install (and multiple domains) at all.
Perhaps you could try using that boostrap file instead, and see if it fixes your issue with template syncing?
Finally, if you're going to use the EE template manager, you don't really need to store templates as files. Conversely, if you want to save templates as files, it's probably much easier editing them using Sublime Text or another editor, rather than the clunky built-in editor (which is really only useful for small/simple changes).
I have created a new website for a client, (joomla) which is currently running within a folder in the root called /new/ (original I know)
I am now trying to work out what would be the best way to switch over the sites, there are a lot of files (pdf's, doc's etc) so moving everything would take some time, plus the old site is very messy, and would also take some time to remove in one go.
What about htaccess, and having a redirect? I could then remove the old site and files from the root over time?
One approach could be the use of symbolic links(ln -s basically), but you won't be able to do that for files that have the same name in both root and your new/ subdirectory. You will encounter this same issue with apache redirects, thus basically, you need to decide before hand what do you want to serve from either root or new/ and resolve the possible conflicts.
I tried searching, but I couldn't really figure out the best search terms to find my answer.
I have a Ubuntu 10.04 server with Apache. I want to set up a site that will be versioned, so my file structure will look like:
/var/www/MyApp1.0
/var/www/MyApp1.1
/var/www/dev -> /var/www/html/MyApp1.1
/var/www/test -> /var/www/html/MyApp1.0
Where "dev" and "test" are symbolic links to the other folders. So my URL for those two environments will be "http://my-url.com/dev" or "http://my-url.com/test". For my prod environment, I want the URL in the browser to be just "http://my-url.com", without redirecting to something like "http://my-url.com/prod".
How can I set it up so that the base URL points to a specific version without a redirect changing the URL?
By the way, we use MS SourceSafe for version control, so we have older versions backed up as well, but I need multiple environments for dev, test, and prod.
Thanks,
Travis
I think you can just check out the right development version to each of your dev, test and 'live' folder. I think it would be easier to just get the right version into the dev folder, than change the symbolic link. Ofcourse you could create a .htaccess file that redirects /dev to a specific version folder, but doing this will just cause you to keep a large amount of different folders for different versions, while what you should be doing is put the website in a version control system, develop features and commit them, update the test folder, and if everything's alright, update your production folder as well.
To do this right you may need to drop SourceSafe.