rethinkdb-python icon indicating copy to clipboard operation
rethinkdb-python copied to clipboard

Restore not working on Windows due to : (colon) in file and folder names

Open StianOvrevage opened this issue 8 years ago • 4 comments

rethinkdb dump by default creates a file that contains colons, such as rethinkdb_dump_2017-01-24T21:34:23.tar.gz. This can be overriden with -f, BUT, since all the actual data files are stored inside a folder named rethinkdb_dump_2017-01-24T21:34:23 inside the archive no matter what -f is set to, it's basically impossible to restore (and probably dump) on Windows.

Windows does not allow colon in paths, and also fails horribly if you try (colon is usually the drive separation sign, such as C:\stuff ).

StianOvrevage avatar Jan 24 '17 21:01 StianOvrevage

_dump.py has logic for Windows, if you dump on that platform.

    # Verify valid output file
    if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
        res["temp_filename"] = "rethinkdb_dump_%s" % datetime.datetime.today().strftime("%Y-%m-%dT%H-%M-%S")
    else:
        res["temp_filename"] = "rethinkdb_dump_%s" % datetime.datetime.today().strftime("%Y-%m-%dT%H:%M:%S")

I think all platforms should use the hyphenated format so that you can dump on Linux and load on Windows.

srh avatar Jan 24 '17 21:01 srh

Aha. Totally agree. See no reason to use colons. Another option would be to also let the folder inside the archive be the same as the filename specified with -f. That would preserve colons by default but allow for cross-platform transfer.

Right now it seems to work if i re-pack the archive:

rethinkdb dump -c localhost:32769
tar zxvf rethinkdb_dump_2017-01-24T21:42:08.tar.gz
rm rethinkdb_dump_2017-01-24T21:21:47.tar.gz
mv rethinkdb_dump_2017-01-24T21:42:08 rethinkdb_dump_2017-01-24
tar -czvf rethinkdb_dump_2017-01-24.tar.gz rethinkdb_dump_2017-01-24

StianOvrevage avatar Jan 24 '17 21:01 StianOvrevage

Hi, @StianOvrevage Do it work dump on Windows?

biapar avatar Feb 12 '17 09:02 biapar

@biapar Yes, dump on Windows creates an archive with name rethinkdb_dump_2017-02-14T20-28-49.tar.gz and contains a folder with the same name.

StianOvrevage avatar Feb 14 '17 19:02 StianOvrevage