Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Windows) Cannot migrate from v3 to v4 #90

Open
NoNameLmao opened this issue Jul 3, 2023 · 1 comment
Open

(Windows) Cannot migrate from v3 to v4 #90

NoNameLmao opened this issue Jul 3, 2023 · 1 comment

Comments

@NoNameLmao
Copy link

NoNameLmao commented Jul 3, 2023

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

@NoNameLmao
Copy link
Author

NoNameLmao commented Jul 3, 2023

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

@NoNameLmao NoNameLmao changed the title Cannot migrate from v3 to v4 (Windows) Cannot migrate from v3 to v4 Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant