Migrating sql entries to collection

I have a database which I want to migrate to my statamic project. I created a fieldset and added a few entries to see how the .md file will look like. Then with custom php script I looped though my database and created a file for each entry (unique slug of course) with the same structure as my fieldset. Then I copied all of these md files in my collections/{collection_name} folder. In the Admin panel they seem to display, but when I edit one and press save it returns an error "slug already exists". The only thing that I'm not 100% sure is do the IDs have to be a certain format ? I don't know how statamic generates them but I just used the ids from my datatbase which are 1, 2, 3 and so on. What can I possibly be missing ? Is statamic creating any additional files when I add a new entry to a collection ?

>>>>>>> Unanswered <<<<<<<
1 Reply