Thursday, June 27, 2019
Simon Tushev

Simon Tushev

Simon is IT professional with interests in web design, electronics, photography and astronomy. He writes about PHP, Yii, Joomla!, Arduino and several other topics.

The following script may help you to transfer or mirror your existing PHP+MySQL website completely from one server to another. You will need SSH accounts on both servers, with public key authentification set up (server 2 has public key in its ~/.ssh/authorized_keys for corresponding server 1's ~/.ssh/id_dsa (id_rsa)  ).

Save the following script as ~/transfer-site.sh, make it executable (chmod +x ~/transfer-site.sh) and launch it on server 1:

#!/bin/sh echo "Starting syncronization..." echo "Starting file transfer" rsync -rvz -e 'ssh -p 22' /PATH/TO/YOUR/EXISTING/SITE/ This email address is being protected from spambots. You need JavaScript enabled to view it.:/PATH/TO/YOUR/NEW/SITE/ --exclude="configuration.php" echo "Starting MySQL transfer" mysqldump --add-drop-table -u dbuser_1 -h mysql.example.com database_1 -pPASSWORD1 | ssh new-server mysql -h mysql.example.org -u dbuser_2 -pPASSWORD2 database_2 echo "All done!"

Is is assumed that you are transferring data from server 1 (example.com) to server 2 (example.org). And, sure, you do not need --exclude="configuration.php" in most cases. This will be useful only if you are synchronizing master Joomla! website with its mirror.

 

To use

ssh new-server

syntax you will need add the following to your ~/.ssh/config:

Host new-server Hostname example.org User username Port 22 PasswordAuthentication no

Keywords: Apache MPM ITK PHP MySQL VPS CentOS

In this article I'm going to describe a typical configuration for a private web server. I assume you use CentOS 6 as your operating system, in other *nix distributions some paths and commands may vary. However, the idea remains intact:)

Most servers require PHP as scripting language, and MySQL for databases

If you run multiple websites, it is always better to run them as different users. Even if a hacker gets access to one of your sites, there's a high chance that the others will remain intact.

Monday, 05 August 2013 13:03

How it works: DS18B20 and Arduino

DS18B20There are many Arduinods18b20 sketches on the Web that provide sample code how to work with MAXIM’s (formerly DALLAS) DS18B20\DS18S20 digital temperature sensors. However, most of them do not describe the process in details. In this article, I’m going to show the gears that make the whole thing work.

Wednesday, 02 March 2011 23:00

Measuring frequency with Arduino

arduino megaThere are many signals that contain necessary information in frequency. For instance, SparkFun's HH100D humidity sensor outputs measurements via frequency signal (although it has i2C interface, those pins are used for reading calibration values. Actual measurements com via FOUT line).

 

There are two ways to measure a frequency with Arduino:

Friday, 03 December 2010 23:00

Reading iButton with Arduino

iButtons  readerWe all are familiar with iButton devices - a small chip used as a key almost everywhere:Those keys use Maxim's (formerly Dallas Semiconductor) 1-Wire protocol. It's a nice thing and it is used in many other devices, like temperature sensors (DS18B20, DS18S20 for instance).

As it comes from the name, 1-Wire devices require only one wire for data transfer. Some devices are also capable of using ithis line as a power source. (However, one will still need another wire - for ground).You can attach a large number of devices to the same line. That's especially well when you are using Arduino - OneWire line takes only one digital pin, and you theoretically can plug all you OneWire sensors, keys etc to this line.

Page 5 of 7

Welcome!

Here I publish articles related to my areas of interest, my brief notes that may save some time to others, as well as some of my works.

This site is a work in progress. I will add more sections in the future, such as

  • More photos to photogallery
  • More Joomla!-related articles
  • ...

 

themeforest

New Posts

Spam/Forgery Notice

If you've received a spam email from @tushev.org, please know that this emails are...

07-03-2019 in Blog

READ MORE

Using dynamic GeoIP module with nginx (CentOS)

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure...

13-04-2016 in Linux, BSD, Unix

READ MORE

Visual difference between pseudo and true random data

This is is "random" image generated using PHP rand() function: And this is an image...

20-11-2015 in Blog

READ MORE
Scroll to top

We use cookies, just to track visits to our website, we store no personal details Privacy policy