Malformed dumpfile header when migrating repository from Windows to Linux (encoding issue?)
Asked Answered
P

2

13

I'm moving an SVN repository from a Windows machine (Windows 7) to a Linux machine (Ubuntu 13). I dump the repo on Windows with svnadmin dump and copy the files to the Linux machine. Now I'm running

svnadmin load dest-folder < dumpfile

And the terminal responds with

'vnadmin: E140001: Malformed dumpfile header 'SVN-fs-dump-format-version: 2

I suspect that there is a problem with my character encoding (Windows vs. Unix), based on the fact that the single quote goes from the end of the line, where it should be, to the beginning. But I have tried converting the character encoding in Notepad++ and I only receive different errors.

The above error shows up when I encode in UTF-8.

When converted to "UTF-8 without BOM" or "ANSI":

' into a number04: Could not convert ' 2

When converted into "UCS-2 Big Endian" or "UCS-2 Little Endian":

svnadmin: E140001: Malformed dumpfile header '?\254?\255'

I don't know anything about character encodings, so I don't know where to turn next. Or perhaps it is a problem with my dump or repo, but I haven't had any issues with SVN until now.

Pyrexia answered 16/9, 2013 at 0:26 Comment(4)
How did you transfer the dump from one machine to the other? Wasn't you using plain FTP by chance? I suspect that if you sent an uncompressed dump file that way and if you did not switch the transfer mode to binary, the file got corrupted in flight. I'd dump again or, if you have a recent enough svn client, just run svnrdump from the client.Ingham
And surely you must not ever attempt any encoding conversions on the dump file: it's supposed to be opaque! The only meaningful problems might be with a BOM marker and/or EOL sequences. Just in case, I've just run an svnrdump using Subversion 1.8.0 on Windows and it produced a dump file with LF only EOLs; the file is UTF-8 with no BOM.Ingham
Oh, and by the way weren't you using PowerShell when you were generating and saving the dump file? AFAIK, its authors were idiots and made it output UCS-2 into pipelines or shell-redirected files -- see this for instance, and this in general.Ingham
@kostix: I copied the file using a flash drive. If I do not edit the file at all and try to use as-is, I get the first error shown above. Finally, I began by using command prompt and switched to PowerShell. This may be my issue, I will try today and post back.Pyrexia
P
26

This answer came from comments by the user kostix on my question.

The issue was that I was using PowerShell to create the dump file. When I switched to using vanilla Command Prompt in Windows, the issue resolves. As pointed out, PowerShell automatically outputs UCS-2 files through pipelines or shell output files, and Linux didn't like that character encoding.

Pyrexia answered 18/9, 2013 at 12:19 Comment(7)
That's not "Linux not liking the encoding" -- rather, that's Subversion expecting its dumps to be encoded in UTF-8 no matter which platform it is.Ingham
Is there a simple way to convert the file to UTF-8?Diffuser
I used Notepad++. It allows you to switch encoding on the fly before saving.Pyrexia
Switching the encoding in Notepad++ didn't work for me. Regenerating the dump from a "vanilla Command Prompt" did.Fossa
I have use the visualsvn powershell tools to iterate over repositories I need and run a workflow on them which included dump. Wrapping the command and output in a .bat file seems to help. Also it's a few magnitudes faster than before.Zoometry
Just adding that the new Windows Terminal also exhibits this problem, even when using the usual cmd window inside it. Vanilla cmd prompt works.Number
Interestingly, this helped me with the reverse situation: dump on linux, load in Windows (VisualSVN). At first I tried PowerShell Get-Content (instead of "cat") and got an error. But old cmd.exe with type command piped into svnadmin load worked.Brotherly
R
2

If you are getting error svnadmin: E140001: Malformed dumpfile header '?\FF?\FES'

Windows SVN dump does not work on Linux SVN if you took backup using PowerShell, I would recommend using vanilla Command Prompt(default) in Windows, It will 10 times faster then PowerShell as well to take dump backup.

svnadmin dump /repository_name > backup_svn.dump

Rebuke answered 27/4, 2018 at 14:26 Comment(1)
certainly much much faster in cmd (Command Prompt) on Win Server 2019Editor

© 2022 - 2024 — McMap. All rights reserved.