Worked for me. I had to remove that duplicate function as indicated above. I went in and deleted all my users except for my new wp admin account and then all my posts disappeared! I re-ran the script, and while it gave errors, it did exactly what I expected and put the posts back in.