12

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.

Kukanani
  • 718
  • 1
  • 6
  • 22
  • 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. – kostix Sep 16 '13 at 10:00
  • 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. – kostix Sep 16 '13 at 10:05
  • 2
    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](http://stackoverflow.com/q/13675782/720999) for instance, and [this](http://stackoverflow.com/search?q=[powershell]+redirection+encoding) in general. – kostix Sep 16 '13 at 10:08
  • @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. – Kukanani Sep 17 '13 at 13:06

2 Answers2

25

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.

Kukanani
  • 718
  • 1
  • 6
  • 22
  • 4
    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. – kostix Sep 21 '13 at 23:14
  • Is there a simple way to convert the file to UTF-8? – Scott Markwell Feb 18 '14 at 21:55
  • I used Notepad++. It allows you to switch encoding on the fly before saving. – Kukanani Feb 19 '14 at 23:07
  • Switching the encoding in Notepad++ didn't work for me. Regenerating the dump from a "vanilla Command Prompt" did. – macleojw Jun 19 '15 at 15:35
  • 1
    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. – vinczemarton Dec 08 '16 at 08:19
  • Just adding that the new Windows Terminal also exhibits this problem, even when using the usual cmd window inside it. Vanilla cmd prompt works. – Colin Oct 15 '20 at 23:31
  • 2
    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. – Justin Jan 12 '21 at 18:29
1

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

Narendra Kumar
  • 199
  • 2
  • 2