Posts Tagged ‘Subversion’
-
Subversion for a Casual WordPress User…Promises and Challenges
There are a couple of things that have made WordPress such a popular blogging platform. Being Open Source, WordPress source code is available for developers to customize and extend. In the process, new bugs and security holes are discovered, and new requirements are considered. In return, WordPress code gets frequently updated to meet changing needs. WordPress also provides a level of abstraction for the casual user that is not found in any other blogging platform. Without writing a line code, the casual user can experiment with thousands of themes and plugins that provide added functionality to WordPress.
The downside is that the code for WordPress, as well as its themes and plugins is never static. WordPress code gets updated several times each year. Themes usually get updated less often. But some plugins can get updated every week!
The WordPress Dashboard informs the user when a new WordPress update is available. It also informs the user if new theme and plugin updates are available. The most convenient option is to configure file permissions and file group ownership such that the “Update” links can be clicked from within the Dashboard. This requires FTP credentials and the updates are downloaded and installed in the background. However, this is sometimes not possible on some servers that are keen on security (PHP Safe mode restrictions).
In addition, updating via FTP, whether through the Dashboard or through a client like Filezilla can be fairly slow. Especially when it comes to updating WordPress code. This means your site will be offline for some time. Updating WordPress code manually through an FTP client requires deleting specific old files, and there is always the danger of deleting the wrong files, which can brick your blog. Updating/Installing plugins via FTP is fast and easy. But suppose if all twenty of your plugins got outdated. This means you would have to download the latest version of each of them to your Desktop, unzip them and upload them. This can be fairly time consuming.
Now imagine the rigmarole if you are entrusted with updating several WordPress blogs.
For the casual user, the lure of using Subversion is being able to update WordPress using a single command. A Subversion update only adds and overwrites pertinent files, and therefore takes the fraction of time an FTP update does (around 15 seconds). In addition, a Subversion update automatically takes care of deleting unnecessary files in a less error prone way. But there are five issues when it comes to switching to Subversion.
Firstly, Subversion can only be used on a WordPress blog that was installed via Subversion. Switching your existing blog to Subversion is not easy. And it can get more difficult if your blog was installed into the root directory of your server, instead of a sub-folder. In that case, you may as well back up each and everything and do a fresh WordPress install using Subversion.

- An FTP view of a Subversion WordPress Installation. Notice the .svn folder. .svn folders can be found in each and every file folder of the Subversion WordPress Installation. These folders contain .svn files which store version information about the WordPress files. An FTP WordPress Installation, or a WordPress theme or plugin installed via FTP does not contain .svn folders or files.
Secondly, updating themes and plugins via Subversion requires command-line acrobatics, for each and every theme and plugin, and in the end, may be more time-consuming than installing them via FTP (these are the additional themes and plugins that are not bundled with WordPress).
Thirdly, Subversion requires that you correctly enter the version number of the latest version you wish to update to. The process is far from automated, and Subversion cannot automatically find the latest stable release. It can however, automatically find the latest bleeding edge/nightly build/trunk version, which hints that Subversion still is a developer tool. The casual WordPress user is highly discouraged from using such untested versions.
Fourthly, using Subversion to update WordPress plugins and themes requires that they be typed into command-line in a special format. For example, the plugin “All In One SEO Pack” must be typed in as “all-in-one-seo-pack.” Thankfully, WordPress plugin pages now feature a direct link to the plugin’s Subversion repository, where such information can be found. This is a fairly recent development, and it indicates the growing importance Subversion is playing at WordPress.
Fifthly, Updating WordPress and updating the themes and plugins are separate processes. So a complete Subversion update consists of three separate processes. Of course, there are those who have tweaked things to create a unified update process. But this is beyond the scope of the casual user.
I have observed that most WordPress users are implementing a hybrid solution when it comes to Subversion. They have switched WordPress to Subversion and use it to update WordPress. However, plugins and themes are still updated via FTP or the Dashboard. The beauty of Subversion is that it allows such coexistence.
There are of course, tools such as the Open Source Tortoise SVN, that add an attractive Graphical User Interface to Subversion. Tortoise creates a local repository of WordPress and its themes and plugins on the user’s hard drive. This repository is updated to latest stable releases in the Subversion online repository, and this “updated” local repository is synched with the user’s online WordPress installation. Recently WordPress’s Matt Mullenweg made a donation to Tortoise SVN, indicating its growing importance as a preferred SVN client for WordPress. There are proprietary SVN clients available as well, that are more advanced than Tortoise SVN.
The issue with most SVN clients is that things can become tacky when it comes to handling multiple WordPress installations. In such a case, the user would be expected to build a local repository for each and every WordPress site that he or she has (or maintains). This means updates can be done only from the computer where the repositories were installed. And again, installing a new plugin on a whim may still be easier via FTP, than through the client interface. Assuming your FTP client remembers your credentials, installing a new plugin traditionally is only a matter of clicking (and this remains one of the feature attractions of WordPress).
The Ideal Subversion Client; A Tentative Wish list for a Casual WordPress User
Given that SVN clients may ultimately emerge as the key to managing WordPress updates, there are some things I would expect from an ideal Subversion client.
-
An ideal Subversion client will not install local repositories on a user’s hard-drive. Local repositories are a vestige of developers, who needed them to commit changes to the source code. Instead, the Subversion client will automatically install/update to the user’s web server from WordPress Subversion repositories. It will be somewhat like giving a Graphical User Interface to the command-line acrobatics presently used (which unlike SVN clients, do not create local repositories on user hard drives).
-
Upon being pointed to a user’s WordPress installation, an ideal Subversion client will be able to automatically detect all versions of WordPress, plugins and themes used.
-
Upon being pointed to a user’s WordPress installation, an ideal Subversion client will be able to convert the WordPress installation to a Subversion WordPress installation. It will also be able to convert themes and plugins installed via FTP/Dashboard to Subversion.
-
Upon being pointed to a user’s WordPress installation, an ideal Subversion client will automatically check what stable versions are available for WordPress, as well as its themes and plugins. Updates should be offered through a Graphical User Interface, that only involves clicking, and no typing.
-
An ideal Subversion client will allow a unified update process for WordPress as well as its themes and plugins at the same time.
-
An ideal Subversion client will allow easy installation of new themes and plugins. This will require some kind of interface with the WordPress themes and plugins directory.
-
Upon being pointed to another WordPress installation, an ideal Subversion client will be able to repeat all of the above successfully.
I know this is too much to hope for, and too soon. But from the perspective of a casual WordPress user, this is the need of the hour.
-
Why Subversion is not a complete way to update WordPress
While WordPress offers the functionality of upgrading core files, themes and plugins via the Dashboard, this feature cannot be used with some webhosts who are keen on security. Upgrading via FTP is time-consuming and error prone. FTP is also not very secure. To quote one webhost, “Its 2012, and you shouldn’t be using FTP for anything.” Subversion offers the promise of
one-clickone-command, lightning-fast, server side upgrades. Is Subversion the way to go or has Subversion yet to grow up for the casual WordPress user? Please note that this posting is more of a documentation of experiential learning in an area that really needs documentation. This is not to be read as a manual. And I am not in a position to offer support.Note: For an Introduction to Subversion, please read my article on its promises and challenges for the casual WordPress user.
What is Subversion?
Subversion is a version control system for software. The basic concept is to host the most recent copy of the software on a publicly accessible web server, known as a repository. Using a few shell based commands, a user can download or upgrade to the latest version of the software. A user can also downgrade to a previous version of the software if he or she finds that previous release more stable. A developer can also access the latest “nightly build” of the software for testing purposes (referred to in subversion as the “trunk” version). All approved developers of the software can commit changes to the trunk version of the software in real-time, making the trunk version of the software a working copy of latest code changes. This is especially helpful for software like WordPress, whose total developers number in four digits.For a long time, repositories were the only painful way to get software and patches for Linux (in the interest of security). Later distributions of Linux added GUIs to make this process more interactive. However, Linux now allows downloading and installing software from websites, provided the installer file has a .apt extension.
How is subversion different from FTP?
FTP involves dumping files from your own computer onto the web server. Subversion works strictly on the web server side (and must be supported by your web server). You issue shell commands to the web server to download software onto your web server.
There are complex ways to make Subversion work locally as well. For example, you could download and install the Tortoise SVN client, which creates a repository of desired software on your hard drive. And this in turn, is synced with your web server. But again, this defeats the purpose of making installation and upgrade strictly web based. And its not as simple as it sounds. I am still looking for a good tutorial.
How is a Subversion WordPress Installation different from a Traditional FTP one?
A Subversion WordPress Installation has a folder called .svn in the main root directory. Similar .svn folders can be found in the Themes and plugins directory, as well as for each and every theme and plugin folder.
The .svn folders store files with the extension of .svn. They contain version information about WordPress and its components. This information is necessary for future Subversion upgrades or downgrades. These files can be downloaded via FTP and viewed with an editor such as Notepad++. But it is not possible not recommended to edit these files in any way. Doing so can “break” Subversion upgrades. It is also not recommended to move them around using FTP, as they store path information which may not be correctly updated. These files are only meant to be handled using a shell-based command line interface. Removing these files makes your WordPress installation identical to a traditional FTP one.
A Subversion WordPress Installation is expected to be only upgraded through subversion. Later doing an FTP upgrade of the Subversion WordPress installation will not impact WordPress functionality in any way. But Subversion will get broken and may not be used again. Installing themes and plugins via FTP on a Subversion WordPress installation will not impact the functionality of these components in any way. Neither will it break Subversion for the core WordPress installation. And neither will such themes and plugins be lost when WordPress is upgraded via Subversion. Likewise, such themes and plugins can only be updated via FTP, not Subversion.
What are the advantages of Subversion
The primary advantage of Subversion is for developers, who need access to latest “bleeding edge” versions of WordPress, WordPress plugins and WordPress themes. There is no other way of accessing this stuff.
For the casual user, WordPress can also be installed for the first time using Subversion. Compared to an FTP install, a Subversion install takes only a fraction of the time (around 15 seconds). Upgrading WordPress via Subversion also takes around 15 seconds. And requires only entering a command. This means your blog will be offline for a lot less longer. And this can be done remotely, as long as you have the right credentials. Upgrading WordPress via FTP requires care. The latest version needs to be downloaded and unzipped. Some files and folders in the existing installation have to be deleted and new ones are then uploaded to replace them. There is always the danger of deleting the wrong files, which can jeopardize the blog.
How to Install WordPress via Subversion
Once you have made sure your host supports Subversion, all you need to do is to connect to your FTP account using a terminal. A free software such as Putty can be used for this purpose.
-
Connect to your website by typing your FTP credentials into the terminal window
-
In a browser, go to WordPress.org and note the version number of the latest stable release (in this case, it is 3.3.1).
-
Go to your root folder using the cd (change directory) command.
-
If you want to install WordPress into a folder such that your blog will be accessible at example.com/blog, type
-
mkdir blog
-
Then navigate to it by typing cd blog
-
-
If you want to install WordPress to the root directory, ignore the previous step.
-
Type svn co http://core.svn.wordpress.org/tags/3.3.1 . Note the trailing dot preceded by a single space.
-
Files will start being downloaded and unzipped. You should be done in less than a minute.
Needless to say, Subversion is not the only way to make a fast install of WordPress. A non-SVN version can also be installed via command line using the following procedure,
-
Connect to your website by typing your FTP credentials into the terminal window
-
In a browser, go to WordPress.org and note the version number of the latest stable release (in this case, it is 3.3.1).
-
Go to your root folder using the cd (change directory) command.
-
If you want to install WordPress into a folder such that your blog will be accessible at example.com/blog, type
-
mkdir blog
-
Then navigate to it by typing cd blog
-
-
If you want to install WordPress to the root directory, ignore the previous step.
-
Type wget http://wordpress.org/latest.tar.gz
-
Files will start being downloaded. To unzip them, type tar -xzvf latest.tar.gz
-
Then remove the zipped file typing rm latest.tar.gz
Once you are finished installing via Subversion, wget or plain old FTP, make sure you are in the WordPress directory, and type the following commands to set up permissions properly:
-
chgrp web index.php
-
cd wp-content
-
mkdir uploads
-
cd ..
-
chmod -R 775 wp-content
-
chgrp -R web wp-content
-
mkdir tmp
-
chgrp web tmp
-
chmod 775 tmp
To enable media uploads via the WordPress Dashboard, you will need to change some group ownership permissions
-
chgrp web wp-admin/async-upload.php
-
chgrp web wp-admin/media-upload.php
Further information on activating your WordPress install and connecting it to your MySQL database can be found here.
How to convert an existing WordPress Installation to Subversion
This is beyond the scope of this article. Please note that converting existing blogs to Subversion can be nightmarish if WordPress was installed in the root folder of the public directory. Although WordPress provides detailed steps and further information can be found, some web hosts do not allow renaming/swapping of the root directory.
How to upgrade WordPress via Subversion
Only a WordPress Installation that was installed via Subversion can be upgraded using Subversion.
-
Connect to your website by typing your FTP credentials into the terminal window
-
In a browser, go to WordPress.org and note the version number of the latest stable release (in this case, it is 3.3.1).
-
Go to the folder that contains the WordPress installation using the cd (change directory) command.
-
Type svn sw http://core.svn.wordpress.org/tags/3.3.1/ . Note the trailing dot preceded by a single space. Note that this is slightly different from the earlier install command.
-
Files will start downloading and unzipping. You should be done in less than a minute. Unlike an FTP upgrade, an SVN upgrade only downloads and updates specific files and components that have been upgraded, and is therefore less time consuming.
-
Login to your WordPress Dashboard using your browser and make sure everything is OK.
How to install additional plugins via Subversion
This is the part where Subversion falters. The WordPress Subversion installation comes bundled only with the Akismet plugin. To install additional plugins, you have to engage in command line acrobatics.
-
Go to WordPress.org and note the latest version of the plugin (In this case, 1.6.13.8).
-
Go to the WordPress plugin Subversion repository and note the name of the plugin. For example, the plugin All in One SEO Pack will be listed as all-in-one-seo-pack.
-
Download and install Vim on your computer. Vim is a command line editor that works very well within the shell environment. Don’t bother learning to use it because we will only make use of it in an indirect, limited way. Of course, there are more user-friendly editors as well, but Vim seems to interface with minimal errors.
-
Connect to your website by typing your FTP credentials into the terminal window
-
Go to the folder that contains the WordPress plugins using the cd (change directory) command.
-
We need to set Vim as the command line text editor. Type export SVN_EDITOR=vi
-
Type svn propedit svn:externals . Note the trailing dot preceded by a single space and the single quotation marks.
-
This will open an editable file in command line. Before you proceed, please note that you will have to use Vim-specific keyboard commands. The mouse will not work. A handy guide to Vim-specific commands can be found here.
-
Go to the line below it using Vim-specific commands and type
-
all-in-one-seo-pack http://plugins.svn.wordpress.org/all-in-one-seo-pack/tags/1.6.13.8/
-
Save the file by typing Vim-specific commands ( : followed by x followed by [return])
-
Type svn update
-
Go to your WordPress Dashboard and activate the plugin.
How to install additional themes via Subversion
This is another part where Subversion falters. The WordPress Subversion installation comes bundled only with two basic themes. To install additional themes, you have to engage in command line acrobatics.
-
Go to WordPress.org and note the latest version of the plugin (In this case, 1.2).
-
Go to the WordPress theme Subversion repository and note the name of the theme. For example, the theme Coraline will be listed as coraline.
-
Download and install Vim on your computer. Vim is a command line editor that works very well within the shell environment. Don’t bother learning to use it because we will only make use of it in an indirect, limited way. Of course, there are more user-friendly editors as well, but Vim seems to interface with minimal errors.
-
Connect to your website by typing your FTP credentials into the terminal window
-
Go to the folder that contains the WordPress themes using the cd (change directory) command.
-
We need to set Vim as the command line text editor. Type export SVN_EDITOR=vi
-
Type svn propedit svn:externals . Note the trailing dot preceded by a single space and the single quotation marks.
-
This will open an editable file in command line. Before you proceed, please note that you will have to use Vim-specific keyboard commands. The mouse will not work. A handy guide to Vim-specific commands can be found here.
-
Go to the line below it using Vim-specific commands and type
-
coraline http://themes.svn.wordpress.org/coraline/1.2/
-
Save the file by typing Vim-specific commands ( : followed by x followed by [return])
-
Type svn update
-
Go to your WordPress Dashboard and activate the theme.
How to upgrade additional themes and plugins via Subversion
When you upgrade WordPress via Subversion, only the Akismet plugin and the two default themes will also be upgraded. The additional themes and plugins have to be separately upgraded via command line acrobatics.
-
Login to your WordPress Dashboard. Your dashboard should indicate which plugins/themes are out of date and what are the version numbers of the new version. Alternatively, this can be done by checking the WordPress plugin and theme Subversion repositories (which is safer, because Subversion can only update to version numbers listed in the repository; For example, the WordPress Dashboard may indicate the new version as version 2.31 whereas the correct format (as listed in the repository) is 2.3.1.
-
Download and install Vim on your computer. Vim is a command line editor that works very well within the shell environment. Don’t bother learning to use it because we will only make use of it in an indirect, limited way. Of course, there are more user-friendly editors as well, but Vim seems to interface with minimal errors.
-
Connect to your website by typing your FTP credentials into the terminal window
-
Go to the folder that contains the WordPress plugins (or themes) using the cd (change directory) command.
-
We need to set Vim as the command line text editor. Type export SVN_EDITOR=vi
-
Type svn propedit svn:externals .Note the trailing dot preceded by a single space and the single quotation marks.
-
This will open an editable file in command line. This is the same file you previously edited to add additional themes or plugins (which should be listed in the file). Before you proceed, please note that you will have to use Vim-specific keyboard commands. The mouse will not work. A handy guide to Vim-specific commands can be found here.
-
Go to the line on which your plugin/theme is listed using Vim-specific commands. Then move your mouse to the version number using Vim-specific commands. And replace the existing version number with the new version number, using Vim-specific commands.
-
Save the file by typing Vim-specific commands ( : followed by x followed by [return])
-
Type svn update
-
Go to your WordPress Dashboard and make sure everything is right.
Conclusion
While updating WordPress through SVN is a breeze, the same does not apply to updating (or installing) additional themes and plugins.
Nowhere is the casual WordPress user near the dream of updating WordPress and all plugins/themes using one command. Rather than a step towards automation for the casual user, SVN as it stands today, is still a developer tool that is best suited for updating to the “trunk”versions. Updating to latest stable releases requires manually entering the version number of the latest stable release. There is no command for automatically updating to the latest stable release.
Clearly, Subversion for WordPress has a long way to go before it can truly replace FTP as a solution to update WordPress. In fact, installing/updating additional themes via FTP may be less time consuming in certain cases (Putty does not remember login credentials). Also, there is quite a margin of error when typing in text via command line, using the convoluted Vim interface.
The precarious typing also takes out the joy of trying out new plugins on whim.
There are of course, complicated ways to create a unified update process for both WordPress and additional themes and plugins. These are clearly beyond the scope of the casual user.
But until Subversion for WordPress grows up, a hybrid solution can be pursued. While WordPress may be be installed and updated via Subversion, additional themes and plugins may be installed using FTP. The two can coexist, and even updating WordPress through Subversion will not affect the functionality of the additional themes and plugins installed via FTP.
Further Reading (Subversion How-To’s)
What WordPress has to say on Subversion
Upgrading WordPress via Suubversion
Useful SVN Commands
Installing additional plugins via subversion
svn:externals command line wizardry (1 & 2)
Loading ... -
What is a techtangerine?
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Mar | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
Keywords
Topics
- Cloud Computing (3)
- How to (7)
- Inkjets (3)
- Linux (1)
- Mobile (3)
- PDFs (1)
- Reviews (8)
- Shopping (3)
- Trends (8)
- Wallpaper (2)
- Windows (2)
- Windows Live Writer (1)
- Wordpress (5)