forscht / ddrive

Discord as a filesystem.
https://ddrive.forscht.dev
MIT License
491 stars 98 forks source link

(Windows) Cannot migrate from v3 to v4 #90

Open NoNameLmao opened 1 year ago

NoNameLmao commented 1 year ago

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:

NoNameLmao commented 1 year ago

issue avoided by using wsl to run migrate.js, still doesnt fix the issue on windows