Best way is by Lua tables, this gives you full control over things you cannot set using worldedit, such as per-node force-place.
Use the method of this mod
https://github.com/minetest-mods/saveschemsEnable mod and when entering the world the mod will run and save schematics to files.