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

Making imports easier by allowing to upload JSON and not copy-paste large text files #4615

Closed
saschafoerster opened this issue Jul 31, 2022 · 8 comments

Comments

@saschafoerster
Copy link

I am trying to migrate manually board by board larger boards. Even one of the smaller exports is 8,5 MB. Larger exports likely will exceed 50MB or maybe more.

Is there a way to import a json directly by uploading it to the server and then using some command? Or maybe a upload-field, where I can directly upload the JSON file, without copy-pasting the content of it (which makes the browser slow, doesn't give feedback to the user for a long time and is simply unreliable).

@xet7
Copy link
Member

xet7 commented Jul 31, 2022

@saschafoerster

Not yet, maybe some In Progress code. I'm writing code that could import/export using CLI, but it's not ready yet.

It's possible to export all MongoDB to JSON but that's not so useful yet. Better would be to save in per board JSON export format, and separate attachment files.

Related Import/Export of Boards/Swimlands/Lists/Cards etc:

Attachments:

@xet7 xet7 pinned this issue Jul 31, 2022
@saschafoerster
Copy link
Author

I think that the export/import of single boards is also broken somehow. I exported from Wekan snap 6.09 to another server, Wekan docker 6.09 and I get an error, that the JSON is not valid:
Bildschirmfoto 2022-07-31 um 14 41 26

For my exporting and importing single boards is important, as my database seems to be full of old files, that are not used anymore. We have a mongodb of 13 GB, even though it should be only 1-2 GB from the files I can see. I guess over the years a lot stayed there.

I also try it the cleanup-script, but it deleted to much on the other hand, but will keep on checking again and find a way to migrate from snap 6.09 to a newer docker version of Wekan.

@xet7
Copy link
Member

xet7 commented Jul 31, 2022

@saschafoerster

Yes, I try to create Import/Export tool that could:

@xet7
Copy link
Member

xet7 commented Jul 31, 2022

For beginnings of that Import/Export CLI tool, I'm following progress of this with great interest:

sandstorm-io/sandstorm#3651

@xet7
Copy link
Member

xet7 commented Jul 31, 2022

Related to database migrations:

Related to attachment migrations:

Related to S3 proxy:

Related to repo migrations:

Related to issue migrations:

Related to calendar migrations:

Related to auth:

Related to JMAP standard format Import/Export:

@xet7
Copy link
Member

xet7 commented Jul 31, 2022

From Meteor Slack 2022-07-31, about splitting code to separate parts

From afrokick

I had a working build script to bundle code with ESBuild and install it via meteorInstall. Maybe someone want to try it, just eval the result of build in your meteor project.

build.js

import { exec } from 'child_process';
import path from 'path';
import { build } from 'esbuild';

// isProduction flag for watch mode
const isProduction = process.env.NODE_ENV === 'production';
const MODULE_NAME = process.env.npm_package_name ?? '';
const NAME_PARTS = MODULE_NAME.split('/'); //to supports @org/package
const isPrefixed = NAME_PARTS.length > 1;

const SAFE_NAME = NAME_PARTS.join('_'); //@org/package -> @org_package

const OUTPUT_FILE_PATH = path.resolve(`./dist/${SAFE_NAME}.js`);

(async () => {
  build({
    watch: isProduction
      ? false
      : {
          onRebuild(error) {
            if (!error) {
              console.log('Build succeeded');
            }
          },
        },
    entryPoints: [path.resolve('./src/index.ts')],
    outbase: 'src',
    bundle: true,
    platform: 'node',
    format: 'cjs',
    external: ['mobx', 'react', 'react-dom', 'mobx-react', 'meteor/*'],
    outfile: OUTPUT_FILE_PATH,
    banner: {
      js: `meteorInstall({'node_modules':{${
        isPrefixed ? `'${NAME_PARTS[0]}':{'${NAME_PARTS[1]}'` : '${MODULE_NAME}'
      }(require,exports,module) {`,
    },
    footer: {
      js: `${isPrefixed ? '}' : ''}}}},{extensions:['.js','.jsx','.ts','.tsx','.json','.less','.css','.html','.mjs']})`,
    },
  })
    .then(() => {
    })
    .catch(e => console.error(e.message));
})();

Run with Node 16:

node build.js

From xet7

Can someone explain what this means? Anyway I'll try. Thanks!

From afrokick

You can use any build tools like SWC or ESBuild to build you code and it’ll work with meteor project.

We want to use it to build microfrontends and load it dynamically via import()

Why not meteor itself?

Because now our code base very large (~ 500k loc) and build time ~ 5min. Event if we use dynamic import from meteor it will increase our build time.

So, the separate project will have a fast build time(because swc/esbuild works fast), will have a separate deploy process and will work with current meteor codebase(thanks to meteorInstall aka install)

Check https://github.com/benjamn/install

In the future, i want to create a package live-modules which brings a possibility to update runtime code without redeploy all codebase.

Some cases:

  • fix localization (we have a PoC and it works perfectly)
  • enable/disable experimental code(also have a small prototype which add new route and page)
  • apply critical bug fix without redeploy all app(yes, it is just a temporary solution but sometimes it is necessary to fix a bug ASAP)

I think it will be usefull for mid/large project:

  • where CI/CD time is large, but you want to deploy some code fast
  • if you want to split the app into microfrontends and load it only if it needs.

Ready https://github.com/itgenio/meteor-live-modules

@xet7
Copy link
Member

xet7 commented Sep 5, 2023

Moved to here from #3966 (comment)

From @nstoeckigt

What are the plans to fix this?

From @xet7

Plan is to figure out the plan. Help welcome.

@xet7
Copy link
Member

xet7 commented Nov 22, 2023

@xet7 xet7 closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants