• Fred Chapman

    (@fwchapman)


    I love this plugin and have been using it on all my sites, but I just discovered a serious problem; however, I found a way to work around the problem and want to share it here so that others can benefit until the plugin can be fixed in a future release.

    The problem is that the plugin does not enclose timestamp values in quotes when backing up the database. This causes a syntax error when importing the database from a backup file in phpMyAdmin. This means that the database cannot be restored directly from a backup file that is created by Version 2.2.4 of this plugin.

    I successfully worked around this problem by doing a regular expression search and replace in a text editor to enclose all unquoted timestamp values in quotes. Since my database is over 50 MB in size, this required a text editor that can edit very large files. I wholeheartedly recommend PilotEdit Lite, which is totally free and fills the bill perfectly!

    Unquoted timestamp values look like this in the database:

    2013-04-02 23:53:46

    Here is a regular expression which finds unquoted timestamps:

    [|!'"]????-??-?? ??:??:??[|!'"]

    Here is the PilotEdit Lite replacement expression to enclose the unquoted timestamp in single quotes:

    '%01%02%03%04%05%06%07%08%09%10%11%12%13%14%15%16%17%18%19'%20

    I tested this on a large database with 100,345 occurrences of the search string, and it worked perfectly. After editing the backup file, I was able to import the database with no syntax errors whatsoever.

    Not all WordPress sites store timestamp values; datetime values seem to be much more common, and this backup plugin handles those just fine. For sites which do have timestamp values, my workaround will help until the plugin can be fixed.

    Thanks for all your hard work on a great backup plugin!

    Fred Chapman

    http://wordpress.org/extend/plugins/backupwordpress/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WORKAROUND: Importing Unquoted TIMESTAMP Values’ is closed to new replies.