WordPress.org

Ready to get started?Download WordPress

Forums

BackUpWordPress
WORKAROUND: Importing Unquoted TIMESTAMP Values (5 posts)

  1. fwchapman
    Member
    Posted 1 year ago #

    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/

  2. Pewit
    Member
    Posted 1 year ago #

    Thanks very much for this

  3. fwchapman
    Member
    Posted 1 year ago #

    You're very welcome!

  4. Tom Willmot
    Human Made
    Plugin Author

    Posted 1 year ago #

    Thanks for posting this, the issue with unquoted timestamps will be fixed in the next release.

  5. fwchapman
    Member
    Posted 1 year ago #

    Thanks, Tom!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic