Pushing/Migrating your local Drupal site to a live-site - url-rewriting

I have installed drupal on my localmachine(ubuntu, Xampp), at localhost.
Path and Pathauto modules are active (a module to produce friendly URLs).
Migrating/Pushing my local install to the www.mysite.com
Exported SQL from phpMyadmin(localhost).
Made a new DB at live site (I think a different name from the localhost-DB does not create any problem).
Imported SQL into phpMyadmin, (mysite).
Changed the username-password-DBname in the sites/default/settings.php in drupal folder.
Now, uploaded the drupal folder and all its content into the /www of the "mysite.com".
Visited the URL www.mysite.com, site looks same as on my localhost, good.
But --
I made a tryPage on my
localhost/drupal, for which
pathauto(cleanURL) recommended the
URL "content/trypage" which i
explicitly changed to "trypage", so
that absolute link to the page is
"localhost/drupal/trypage" and not
"localhost/drupal/content/trypage".
Now When i click the trypage link on the mysite,
it open's it in-reference to my
localhost, my local-pages are
opened. That is, when I click
newpage on the mysite.com, the URL
requested is
"localhost/drupal/newpage" and not
"www.mysite.com/newpage".
Do you think it is coz of the SEO
friendly URL generation issue, the
Pathauto module.
Anyways how do i solve this
If I make my "localhost/drupal" to open from same URL (mysite.com), i dont know how
to do that exactly, i think by configuring
vhosts. But if i do that, then the URL
www.mysite.com where will it take
me, local or online.
Now If i add new modules, new content, new pages, and new books on my localhost site, and wish to update mysite.com, do i have to redo SQL export/import everytime, and use a software like rsync/sitecopy(), to upload the folders on the live site. How do i solve this.

This is an old question, but here are some thoughts.
Links generated by Drupal (e.g. menu links, links within the admin area, breadcrumbs, etc.) should always use the domain of the currently requested site. URLs within Drupal are handled by the "router", which stores all paths within the database in a relative format.
That said, unless you're specifying the site URL in settings.php (the $base_url variable) or are linking to pages using fully qualified URLs, this shouldn't be a problem. Linking to different nodes from other nodes can be handled with a variety of modules. Pathologic is a good choice, or Path Filter.
Moving Drupal sites from development to staging to production is still a common problem for which there is no definitive solution. This question was asked previously here.

Related

How to make Drupal links relative

Recently began exploring Drupal (and web development as a whole). After setting up Drupal on my local apache server (xampp), I've noticed that the links all refer to the root of the webserver, instead of relative to Drupal's directory (Drupal is located in a sub dir of my webserver).
I've tried searching google, but don't know exactly what to search for.
How to change this behaviour?
You have to set up your sites correctly in your hosts file.
There are plenty of tutorials on this.
Currently your hosts file probably redirects to your webserver, you have to set up each site you create to redirect to your drupal webroot.

Wordpress Issues Regarding IP and Domain Name - Host Gator

I am hoping somebody can help me because I am on the verge of frustration tears.
The company I work for has a site hosted on godaddy and has to remain up until I complete the rebuild on hostgator, using the Wordpress theme, Grand Restaurant http://themes.themegoods2.com/?theme=GrandRestaurant
To get around the domain name issue since I cannot change nameservers yet, I had to use the Google Chrome plugin, Virtual Hosts, which has me input the IP and domain, to force access to the site.
Everything was working fine until I needed to use the "content builder." If you look at the Grand Restaurant theme, you can click on Menu. I need to use the "Menu Grid" option in the content builder but it does not work. Whenever I try to add the menu grid, it appears that it is trying to load (showing the gif loading image) yet in never actually loads. I have spent several days and hours going back and forth with host gator and the theme developer.
The theme developer says that the content builder does not work because:
"The WordPress URL and Site URL are set to the domain name. When you are logged in, you are being redirected to the IP, so the browser sees 2 different sites and some functionality ex. AJAX call doesn't allow you to get data from different URLs.
Your WordPress URL and Site URL settings are different from your actual site. You have to change your Domain Name URL and Site URL settings to the IP number."
I did what he said earlier today and it completely broke the site. Spent nearly 2 hours with host gator's tech support to get it back up. All tech support will tell me in regards to the content builder not working is that I need to change the AJAX file to allow the site URL and wordpress URL to be different. I have no idea how to do that!
Any wisdom you all could provide would be greatly appreciated. I have 1700 bakery items that I need upload by the end of July and I do not know what I am going to do if I cannot get the content builder working.
In order for this to work properly you should be using a method of back up and restore. By migrating from one hosting provider to another you could simply deploy the new Wordpress on host gator as a new site and import the Wordpress backup to the host gator with the many different plugins available through Wordpress. The way your trying to complete this is impossible and usually will only work with images and back ups being managed on virtual machines, and VPS. It won't hurt anything on the original up and running site. You mentioned that host gator was able to get the site back up? You shouldn't have to rebuild this if you use a back up and restore method. Everything should fall right into place, you can also test these methods through virtual box, and VMware virtualization products which offer trial versions. Try using a migration method and see if the conflicts still persist with the content builder.
Heres is what I would do if you cannot change the domain over but still use the domain for the dev environment.
Modify your hosts file and use hostgators IP and the company domain as the entry.
Install wordpress to the current company domain by simply entering the domain (Should go to hostgators server since you've added that entry in your hosts file)
With the hosts file modification, you should be able to view the wordpress site thats hosted with hostgator using the live domain name.
This way, when you're launching, theres no need to do any modification on wordpress. Simply change the DNS over, revert your hosts file and the site will swap over seamlessly.

Hostgator Addon Domain Redirecting to Primary Domain Subdirectory

This is for a client so I won't share exact domains but the problem is as follows..
I took over development of a website from a prior developer.
The hosting is Hostgator Business.
The primary domain is primary.com.
There is an addon domain addon.com.
The primary domain document root is /home1/username/public_html.
The addon's document root is /home1/username/addon.com.
www.addon.com had a WordPress installation which the developer had edited instead of using plugins to achieve his goals. The site also needed a complete redesign so I felt it logical to simply wipe the installation and replace it.
So, I deleted all of the WordPress files and uploaded a new copy of WordPress from wordpress.org/latest.tar.gz
Prior to deleting the old installation, the domain loaded files from it's document root perfectly.
After uploading the new installation instead of resolving to addon.com it is instead resolving to primary.com/addon.com
I've never seen this happen before so I'm lost.
There's no errors in any available logs.
All file permissions are correct.. I've triple-checked.
I've tried deleting all files and creating simple index.php and index.html files to see if it would access them ... it doesn't.
This happens in each browser I use on Windows and Linux.
I don't understand it because all I did was swap out the old WP install for a new one.
I went and re-uploaded the old WordPress installation so everything is 100% how it was but it is still going to primary.com/addon.com instead of addon.com.
Has anyone faced this issue before? I usually use Bluehost but even when I've used Hostgator in the past I've never seen this happen.
I double-checked the addon domain settings as well as anything else I could think of and everything appears normal.
I even deleted the addon domain and re-added it with the document root of /home1/username/addon.com and it still goes to primary.com/addon.com in the browser.
I submitted a ticket with Hostgator but they have not replied yet.
I'm sorry if this is long. This is my first time asking for help on here and I wanted to be sure I included everything I could.
Hostgator finally got back to me.
The previous developer had used the one-click WordPress install.
Apparently once someone uses a one-click install the only way it works is if you keep using the one-click install/you cannot do it manually any more.
From all the servers and sites I've setup this makes no sense and is a problem with Hostgator. Support did not really tell me anything other than "you have to use the one click install since the prior developer did". Great service.
Hope this saves someone some hassle.
From this it sounds like you were moving a WordPress site from the primary domain to an add on domain.
Simply moving the files from the primary to the add on domain will not make it work on the add on domain because in the database and throughout the coding of the WordPress site it would all be configured and coded for the primary domain.
It sounds like you would need to update the site home and site url from the primary to the add on domain url.
http://support.hostgator.com/articles/specialized-help/technical/wordpress/wordpress-home-fix
Also I would be suggest using a search and replace type plugin to go through all the internal coding to update the urls and links to the add on domain.
There is more information here as well http://codex.wordpress.org/Moving_WordPress

*some* magento links pointing to old domain

I have just moved a magento site from one domain to the new one. Steps so far...
Backup the database and restore the database on the new domain. Change the core_config_base table for secure and unsecure base urls
Upload source files
Update the local.xml with new database information
Cleared cache
Now I can go to the site and everything is showing up fine on the new domain. The main navigation is working as it should. When I click on a product, however, it goes to the old domain. Does anyone know why this might be happening?
Can you verify the links when you hover products are correct or in correct consistently? Is old base URL in all links I mean. Also check htaccess file for any directives containing the old domain. Also check to make sure no custom URL rewrites exist in the Magento admin Catalog → URL Rewrite Management .Once you verify htaccess or custom URL rewrites in Magento admin are not causing it, I can suggest other procedures to fix.
Probably your previous developer didn't follow all Magento standards while coding.
My suggestion is download your code and search for strings that equates to your previous domain.Also check in data base, as use of CMS blocks too might result in previous domain links.
Btw make sure you delete all caches
Rm -rf var/cache/*
Verify base URL and secure URL are correct in all scopes via drop down in Magento system configuration.

Troubles after installing Two stores with same php docroot

I am trying to setup multiple stores within same hosting account and I studied many interesting guides out there on the matter.
Seems to me I figured out simplest solution for me - map both my dot com sites onto the same directory on host, and modify .htaccess to launch different website depending on URL, like so:
SetEnvIf Host .*anatscraftonia.* MAGE_RUN_CODE="anatscraftonia";
SetEnvIf Host .*anatscraftonia.* MAGE_RUN_TYPE="website";
My first store works fine, but when I go to anatscraftonia.com , all I get always is a Magento 404 page.
I checked all settings, multiple stores are defined and code above is copy/paste from Admin console under Website I added. I have Home page enabled for All Stores and Base URL redefined for both Secure/Unsecure. I also tried changing website to store, with no improvements.
What else am I missing? How do I even know what page is it trying to go to, or whether it even gets “no-route” or just totally whacked…
I threw together some quick and dirty code a few years ago to log the controller dispatch process in Magento Community 1.3x.
http://alanstorm.com/magento_controller_dispatch_logging
I don't think you'll be able to drop those files into a current installation, but it should give you an idea where to stick some logging functions to see why Magento is routing to a 404.
I am not 100% sure what you are trying to achieve but why not use a single instance of magento to handle both stores and magentos own multi store capability..
full details here http://dx3webs.com/front/2010/08/magento-multistore-setup-under-plesk/ post contains links to cpanel instructions as well.
the instructions are for multiple domains but will work with sub folders

Resources