microsoft / ManagedEsent

MIT License
242 stars 36 forks source link

Altering the page size of an existing database #40

Closed mwinterb closed 3 years ago

mwinterb commented 4 years ago

Is there an (offline) mechanism for translating an existing database file from one page size to another?

MsftBrettShirley commented 3 years ago

This is not easily possible today. The very ugly workaround is this:

  1. xcopy esent.dll to esent-alt.dll.
  2. LoadLibrary( "esent-alt.dll" )
  3. Fetch only the functions you need to set page size param and read data.
  4. Set old page size in esent-alt.dll.
  5. Set new page size normally (implicitly against esent.dll that loaded automatically)
  6. Read data out of originaly DB attached to esent-alt.dll, and insert it into a newly created DB with the implicit esent.dll.

Hope that made sense.

BrettSh [MSFT]