- Groupings and hierarchies are graphs.
Try Gephi - it can import from database, edit graphs from scratch, export to various text formats, starting from CSV.
You will have to write import routines from text graph formats to database. Explore formats wisely with this in mind.
Also, you may need to do some temporary tables and UPDATE JOIN, since Gephi (and likely other graph software) only can have ID (from DB) and label (name + some crucial attributes) in graphs, graph nodes are not records.
This is the best option since you will be able to solve extra tasks on your data.
- Export data to XML. Use any XML editor (or software IDE - they often have XML support) capable of collapsing tree parts and drag'n'drop. Then re-import, using hierarchy.
I just tried freeware version of EditX on copy of my old backup disk structure dump - works.
- Export to files and folders (under thousand is not too much anyway), sort out by file manager and command line utilities, re-import with filesystem tree traversal script.