ddrive
ddrive copied to clipboard
(Windows) Cannot migrate from v3 to v4
following the guide https://github.com/forscht/ddrive/#migrate-from-v3-to-v4 i saved the v3 metadata into old_data.json but had to force encoding to utf-8 because it had two "replacement symbols" at the beginning (FF FF in hex), but thats not the point
when i run migrate.js it immediately says "Migration Done" without anything actually being done. i have done some diagnostics (console.log()
everywhere) and here are the results (all in order):
// 1
const rootDir = await knex('directory').whereNull('parentId').first()
// 1
{
id: '776d8a81-9bb7-4578-8e81-2a4a7cdc8871',
name: 'root',
parentId: null,
type: 'directory',
createdAt: 2023-07-03T13:58:35.267Z
}
const createDir = async (dirName = '/', parentId = null) => {
try {
// 2 and 4
const dir = directories.find((d) => d.name === dirName)
// ...
// 3
const childDirectories = getChildDirectories(dirName)
.map((d) => path.normalize(`${dirName}/${d}`))
}
// ...
})
// 2
{
name: '/',
mid: '981266509915652176',
type: 'directory',
createdAt: 1654022567014,
id: '15e88766-77aa-49a8-9dc3-b5cee31432d8'
}
// 3
[
'\\folder1',
'\\folder2'
]
// 4
undefined
undefined
ddrive v3 still works p.s. i have already ran ddrive v4 once and postgres database was already created and now there's metadata on it
some more info:
- node v18.16.0
- npm 9.5.1
- windows 11 22h2 build 23419.1000
- docker engine v24.0.2
edit: metadata json itself doesnt seem to be corrupted, require() and destructuring into files and directories work fine
issue avoided by using wsl to run migrate.js, still doesnt fix the issue on windows
- node v16.20.1
- npm v8.19.4
- n v9.1.0
- debian wsl with kernel 5.15.90.2