Edited version
If you recently upgraded to AnkiDroid2, and after following
the official instructions you still can't get your old decks back, here is a set of safe step by step instructions to get your decks working with the new version of AnkiDroid.
This guide is for windows users; please allow 15-60 min to do this depending on your level of familiarity with Anki/Ankidroid/PC.
If you are still having trouble after following this guide, please post here rather than starting a new thread.
Part A: Backup old AnkiDroid files to your PC
1) Connect your device to the PC with USB cable
2) Open windows explorer and click on your Android device
3) You should see a folder called "AnkiDroid" listed in your device
4) Copy this "AnkiDroid" folder to your Desktop
Note: To save time you could now delete the "collection.anki2" file from the AnkiDroid folder on your device, then restart AnkiDroid and it should try to run the upgrade process again. If it still fails then proceed to Part B/B2
Part B: Upgrade old decks with Anki desktop software
2) Open the anki desktop software that you just installed
3) In this anki desktop software go to file->import
4) Now navigate to to Desktop/AnkiDroid -> Change ("Files of type" > "Anki 1.2 Deck") -> Choose the first .anki deck
5) Do the same thing for each .anki deck in the AnkiDroid folder
6) If you get an error please see Part B2 below, otherwise ignore Part B2
7) Check that all of your decks are now listed in the main Anki software
Part B2 (only if you got an error in step 5 of part B): Fix the erroneous deck(s) with an older version of the Anki desktop software.
2) Go file->open and choose the .anki deck from your Desktop/AnkiDroid folder which failed in part 5 above
3) Now click the open button next to your deck name in Anki Desktop 1.2.8
4) Go to Tools->Advanced->"Check Database"
5) Click File->Export->Export
6) Write the name of your deck and save the file to your desktop
7) Repeat steps 2 - step 6 if multiple decks failed in step 5 of part B
8) Close Anki Desktop Version 1.2.8
9) Open Anki Desktop Version 2.0.x
10) Import each of the new deckname.anki files you just saved to the desktop
11) Check that all of your decks are now listed in Anki Desktop Version 2
Part C: Copy the upgraded decks back to your device
1) In Anki Desktop software go File->Export and click "Export" button
2) You should see a message saying a file called "collection.apgk" has been saved on your desktop
3) Go to your desktop and copy the "collection.apgk" file
4) Now open your mobile device again with windows explorer
5) Navigate to the AnkiDroid folder
6) Right click and paste the "collection.apgk" file
7) Now open AnkiDroid, open the menu and choose "Import cards" then click OK
Now you should see all your decks there ready to start reviewing.
Part D: Move any media on your device to the "collection.media" folder (not necessary if you don't use media)
1) In windows explorer open the AnkiDroid folder on your Android device again
2) Confirm that there is a folder called "collection.media" and some other folders that look like "deckname.media"
3) Open the first "deckname.media" folder
4) Select all files (press Ctrl+A on the keyboard)
5) Right click and Copy
6) Now go back and open the "collection.media" folder
7) Right click and paste
8) Wait for all the media files to finished moving
9) Repeat steps 4 to 8 for each of the other "deckname.media" folders
10) Confirm that all your media files are now in the "collection.media" folder
11) Optional: you can now delete the "deckname.media" folders if you like since these are not used in AnkiDroid2