diff --git a/ClicksMigratingProblems/index.js b/ClicksMigratingProblems/index.js
new file mode 100644
index 0000000..3c70cc2
--- /dev/null
+++ b/ClicksMigratingProblems/index.js
@@ -0,0 +1,147 @@
+import fs from 'fs';
+import { MongoClient } from 'mongodb';
+
+const mongoClient = new MongoClient('mongodb://127.0.0.1:27017/local');
+await mongoClient.connect()
+const database = mongoClient.db("Nucleus");
+const collection = database.collection("migrationTesting");
+
+// Loop through all files in the oldData folder
+const files = fs.readdirSync('./oldData');
+let x = 0
+for (const file of files) {
+    console.log(`┌ Processing file ${x} of ${files.length - 1} | ${file}`);
+    // Read the file as a json
+    let data
+    try {
+        data = JSON.parse(fs.readFileSync(`./oldData/${file}`));
+    } catch {
+        console.log(`└ Error reading file ${file}`);
+        x++
+        continue;
+    }
+    // Check if data version is 3
+    if (data.version !== 3) {
+        console.log(`├ Version was too old on ${file}`);
+        console.log(`└ Skipping file`);
+        x++;
+        continue
+    }
+    // Convert to the new format
+    const newData = {
+        "id": data.guild_info.id.toString(),
+        "version": 1,
+        "singleEventNotifications": {
+            "statsChannelDeleted": false
+        },
+        "filters": {
+            "images": {
+                "NSFW": !data.images.nsfw,
+                "size": data.images.toosmall
+            },
+            "wordFilter": {
+                "enabled": true,
+                "words": {
+                    "strict": data.wordfilter.strict,
+                    "loose": data.wordfilter.soft
+                },
+                "allowed": {
+                    "users": data.wordfilter.ignore.members.map(user => user.toString()),
+                    "roles": data.wordfilter.ignore.roles.map(role => role.toString()),
+                    "channels": data.wordfilter.ignore.channels.map(channel => channel.toString())
+                }
+            },
+            "invite": {
+                "enabled": data.invite ? data.invite.enabled : false,
+                "allowed": {
+                    "users": data.invite ? data.invite.whitelist.members.map(user => user.toString()) : [],
+                    "channels": data.invite ? data.invite.whitelist.channels.map(channel => channel.toString()) : [],
+                    "roles": data.invite ? data.invite.whitelist.roles.map(role => role.toString()) : []
+                }
+            },
+            "pings": {
+                "mass": 5,
+                "everyone": true,
+                "roles": true,
+                "allowed": {
+                    "roles": [],
+                    "rolesToMention": null,
+                    "users": null,
+                    "channels": null
+                }
+            }
+        },
+        "welcome": {
+            "enabled": data.welcome ? (data.welcome.message.text !== null) : false,
+            "verificationRequired": {
+                "message": null,
+                "role": null,
+            },
+            "welcomeRole": data.welcome ? (data.welcome.role !== null ? data.welcome.role.toString() : null) : null,
+            "channel": data.welcome ? (data.welcome.message.text !== null ? data.welcome.message.channel.toString() : null) : null,
+            "message": data.welcome ? (data.welcome.message.text) : null
+        },
+        "stats": [],
+        "logging": {
+            "logs": {
+                "enabled": true,
+                "channel": data.log_info.log_channel ? data.log_info.log_channel.toString() : null,
+                "toLog": "3fffff"
+            },
+            "staff": {
+                "channel": data.log_info.staff ? data.log_info.staff.toString() : null,
+            }
+        },
+        "verify": {
+            "enabled": data.verify_role !== null,
+            "role": data.verify_role ? data.verify_role.toString() : null,
+        },
+        "tickets": {
+            "enabled": data.modmail ? (data.modmail.cat !== null) : null,
+            "category": data.modmail ? (data.modmail.cat !== null ? data.modmail.cat.toString() : null) : null,
+            "types": "3f",
+            "customTypes": null,
+            "supportRole": data.modmail ? (data.modmail.mention !== null ? data.modmail.mention.toString() : null) : null,
+            "maxTickets": data.modmail ? (data.modmail.max) : 5
+        },
+        "moderation": {
+            "mute": {
+                "timeout": true,
+                "role": null,
+                "text": null,
+                "link": null
+            },
+            "kick": {
+                "text": null,
+                "link": null
+            },
+            "ban": {
+                "text": null,
+                "link": null
+            },
+            "softban": {
+                "text": null,
+                "link": null
+            },
+            "warn": {
+                "text": null,
+                "link": null
+            },
+            "role": {
+                "role": null
+            }
+        },
+        "tracks": [],
+        "roleMenu": [],
+        "tags": data.tags
+    }
+    // Insert the new data into the database
+    await collection.updateOne({ id: data.guild_info.id.toString() }, { $set: newData }, { upsert: true });
+    // Delete the old file
+    fs.unlinkSync(`./oldData/${file}`);
+    console.log(`└ Successfully migrated file ${file}`);
+    x++;
+}
+
+
+// console.log((await collection.findOne({ id: "your mother" })));
