This tutorial will teach you how to use the FTP client WINSCP to synchronize your localhost gpEasy CMS install with your server/web site install of gpEasy CMS. Learning this tutorial will make life a lot easier when dealing with gpEasy upgrades, backups, working form the local installation, etc.
You need to have a localhost install of gpEasy (see the xampp tutorial). You will also need a server to sync with. You can either install gpEasy into the server via another method or with the first sync you can upload your entire gpEasy local install to your server. You will also need to download WinSCP, install it, and set it up with your server settings so you can access your server with WinSCP. WinSCP has lots of documentation so you should be able to get it up and running on your own. Tutorials to read before this one: Xampp Lite Install & gpEasy Install.
The pictorial tutorial below has most all the information in the step by step tutorial that comes after it. A bit of redundancy isn't always bad.
In the left panel navigate to your local install of gpEasy.
For this tutorial I'll be synchronizing the data folders between the local install and the server. So, in the left panel go into the data folder.
Notice the left panel is open to the data folder of the local installation of gpEasy.
Now you want to go to the data folder on your server in the right panel.
Notice that the data folder is now open on both ends, the server and local installation. It is very important to make certain that you are in the correct folders when synchronizing otherwise you will sync the wrong folders.
Go to the menu, commands, and synchronize, or use Ctrl+S
The synchronize dialog will open. The first and most important thing to check is that the correct folders are set to be synchronized. Look at the local directory and remote directory pathways. This is very important to get right!
There are several setting in the sync command dialog that will appear. The default setting are best. Basically you want to sync from your local installation of gpEasy to your server. In general you will keep your local install as your working installation and only sync when you want to update your server.
Therefore, you will keep the target directory as remote. There may be times you want to change that but in general you want to work from your local install and sync the server.
The mode will be synchronize files. This is the safest bet. It's working in one direction thus you don't have to worry about suddenly having both installations go bad.
As for sync options I generally go with modification time and preview changes. My server works with modification times but yours may or may not. The preview option allows me to see what's going to be synchronized before it is done. This is nice because if I've deleted files on the local install it will show those files and give me the option of having them deleted with the sync or not.
I generally don't go with the 'delete files' option because I may make a mistake and move a file or something dumb and I don't want the sync to automatically delete files. I would rather be in control of that with the preview.
Finally, you can check 'use same options next time' so all your setting will be saved, if you even made any changes this time.
Also note the pathways. They both should be pointing to the data folder!
Don't worry. The sync won't take place without giving the preview if you followed my setting. When you click OK it will go through a check to see what has changed between the locations.
Once the file check is done you will get a window like this. This is your preview checklist. If there are files that you don't want to sync you can uncheck them now.
This time when you click OK you had better be sure because it will synchronize the files.
I'm sure so I'm going to click OK.
This is what you will see while the files are being synchronized. As long as no errors come up and the sync finishes you are good to go.
In this tutorial we only synchronized the data folders; however, the procedure is the same for any set of folders, open both local and server folders in WinSCP and sync.
Notice that you could have uploaded your entire gpEasy local installation right to the server. This is an easy way to install gpEasy on a server that you know gpEasy works on.
What folders should I sync?
Most of the time you will sync the data folder as this is the folder that contains all your personal changes. When you upgrade your local install you will sync the include folder or better yet just remove it from the server and upload the new one. From time to time you may need to sync your themes. That all depends on if you make any changes to them or not.
See the tutorial on gpEasy folder structure for a better understanding of what each folder in gpEasy is for.
Synchronizing from a local install will make life a lot easier. You can do all your work locally without internet access or using bandwidth on the server or crashing your site. You will also head off any problems on the local install before updating to the server.
Using xampp lite with WinSCP can make your life a lot easier in the long run. It might be a little effort in the beginning but over time you will appreciate it.
Step 1
Launch WinSCP and login to your server.
Step 2
On the left side panel of WinSCP navigate to your local install of gpEasy.
Step 3
On the right side panel navigate to your server's install of gpEasy.
Step 4
Choose the folders you wish to synchronize. In general there are two folders that you will synchronize between installs when dealing with gpEasy CMS. They are the data folder and the themes folder. The other folders are rarely synchronized except during problems or upgrades. At this point let's choose the data folder. Open the data folder in each pane, so it's open on both the server and the local install panel.
Step 5
Now in WinSCP go to the file menu, then commands, and click synchronize.
Step 6
There are several setting in the sync command dialog that will appear. The default setting are best. Basically you want to sync from you local installation of gpEasy to your server. In general you will keep your local install as your working installation and only sync when you want to update your server. Therefore, you will keep the target directory as remote. There may be times you want to change that but in general you want to work from your local install and sync the server. The mode will be synchronize files. This is the safest bet. It's working in one direction thus you don't have to worry about suddenly having both installation go bad. As for sync options I generally go with modification time and preview changes. My server works with modification times but yours may or may not. The preview option allows me to see what's going to be synchronized before it is done. This is nice because if I've deleted files on the local install it will show those files and give me the option of having them deleted with the sync. I generally don't go with the 'delete files' option because I may make a mistake and move a file or something dumb and I don't want the sync to automatically delete files. I would rather be in control of that with the preview. Finally, you can check 'use same options next time' so all your setting will be saved. Also note the pathways. They both should be pointing to the data folder.
Step 7
Click OK. WinSCP will check your local files against the server files and then give you a preview of what's to be synchronized. If everything looks correct in the preview click OK and WinSCP will synchronize your data folders.
That's all there is to synchronizing a folder with WinSCP. You can make bookmarks in WinSCP to quickly navigate to the folders you want to sync then just click the sync command. If you are really adventuresome you can read WinSCP's documentation on scripting to setup a script that will do all of it automatically. Personally I like the hands on approach since I don't sync that often and it's usually just the data folder.
As you can tell once you have a local install of gpEasy on your computer it's easy to sync it to a server; therefore, when you want to upgrade your localhost you do just that. Make sure everything works properly on the local install and when you are sure everything is fine you just sync the include folder and wallah, the server is upgraded.
It may be a little effort getting WinSCP up and working properly but in the long run you will be glad you did.
Make sure you backup your local install (the entire xampp & gpEasy install) on a regular basis in case of disaster. If such an event should happen just unzip your backup and you are right back in the game.
Having both a local install and your web site also allows you to know when a problem in gpEasy is actually a gpEasy problem and not a server problem. Furthermore, you save bandwidth and time working from you local install as it's much quicker to work with and you aren't constantly accessing pages on your site which could cause your visitors some problems as well.
It might sound like a lot, getting xampp lite going with a gpEasy local install and WinSCP but it really isn't. Just take your time, play with it. . . after all it's a local install and if you mess things up just start over. Now head on back to the gpEasy tutorials.