Last updated by glass.dimly on Sat, 2008-08-09 00:36
- We will be using the example site 'mysite' here
- This is for a multisite setup, so we will be using an existing Drupal install.
- The example is for a 6 (suffix '6') site, but the procedure is the same for 5, 4.7 and head sites.
- We will be using SVN, but the method for a CVS checkout is almost identical.
Checkout a copy of the site with Eclipse
- Window -> Open Perspective -> Other -> SVN Repository Exploring
- Right click -> 'New' -> 'Repository Location', enter repository details. If you are using SVN you can instruct it to use your SSH key to login so it doesn't ask your for the site creds each time.
- Browse the repository to find appropriate site root (trunk), right click -> 'Checkout...'
- Add using the 'New Project Wizard' and select the PHP project type.
- Save your new project in ~/workspace/mysite.6
Make a local copy of the site database
On the remote server:
- Use
mysqldump -u w_mysite -p -h 127.0.0.1 -P PORT live_drupal > mysite_DATE.mysqlto create a database dump (replacing PORT and DATE as appropriate).gzip mysite_DATE.mysqlto compress it - Alternatively use pushdb with the --backup parameter, which will dump a compressed backup in the nobackup directory.
From your local machine:
- Download a copy of the file - you can use ssh/sftp directly in the Nautilus file browser in Ubuntu (see HOWTO), or sftp/scp from the command line
- Import the dump (mysite_DATE.mysql) to a new database (mysite):
gunzip mysite_DATE.mysql.gz
mysql -uroot -e "CREATE DATABASE mysite;"
mysql -uroot mysite < mysite_DATE.mysql- Edit the Drupal settings.php to connect to your mysite database. If this is a new Drupal 6 site you can use the web installer to do this step for you.
Wire it together
- Add a symlink to your site in the appropriate Drupal sites directory:
cd ~/workspace/drupal-6/sites
ln -s ~/workspace/mysite.6Hint: if you need to symlink several sites at once you can use ln -s ~/workspace/*.6
- Add an alias for your new domain (mysite.6) to your /etc/hosts file
You can do this using 'System -> Administration -> Networking -> Hosts' and addingmysite.6as a new line for the 127.0.0.1 entry (click properties to edit). Alternatively edit the /etc/hosts file (as root) and add the new host to the end of the 127.0.0.1 line.
***Get phpmyadmin working
taken directly from here: http://www.blog.highub.com/linux/install-and-configure-phpmyadmin-on-ubu...
If you haven't already done so:
apt-get install phpmyadmin
To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf, first type the following command to open up this file:
gksudo gedit /etc/apache2/apache2.conf
Add the following line of code inside apache2.conf:
Include /etc/phpmyadmin/apache.conf
Now restart Apache:
sudo /etc/init.d/apache2 restart
Try it out!
- Start up Firefox and browse to http://mysite.6/
- The site will likely be broken on the first visit as the paths will be wrong, to fix this:
- Go to http://mysite.6/user and log in as an admin user
- Go to http://mysite.6/admin/modules
- Go to http://mysite.6/admin/themes
Problems?
- Check file permissions for
~/workspace/- try doing a:chmod -R 777 ~/workspace/ - Check the logs:
tail /var/log/apache2/error.log - For a non-multisite or non-Drupal site you can use myfullsite.localhost as the domain. The symlink step is unnecessary in this case, as we have a complete site in ~workspace/myfullsite.