When you upgrade Caché from any previous version, every time you should look at Upgrade Checklist in the documentation, and this checklist while upgrade from such old version as 5

And even with just a search by documentation you may find this link, with a text

SPOOLER Heading Processing Changed
In this version, a number of changes have been made to the HEADING and FOOTING statements, and general printer/terminal output in this context. Applications that depend on the format of SPOOLed output should be carefully checked to make sure the output still conforms to expectations.

in your code,

obj - it is some object, it may have some ID or not, if it just created

name1 - it is a value for property name in that object

but I completely don't understand why is here name2 and name3, and what do you suppose should be happens after this line ?

and how it should save data in other objects which we even don't know which ?

you should know somehow which objects you want to update. If you know only some other properties, you can use SQL command UPDATE 

You should actually read this tutorial.

Every class, has some types of elements, and some of them like Property and Parameter may contains some data.

Property stores data for every objects in this class, Parameter, for class itself.

In your example, saving data to properties of object was right. But in method PrintDetails, you try to read data from Parameter, not from property. To read data from property you should open this object before, but you also need to know an ID for such object.

#; open object by known ID
set obj=##class(Sample.Employeedetails).%OpenId(1)
#; if obj is empty, so this object could't be found, and open

#; ouptut property Name for this object
​Write !,obj.Name

Please forget about old-way programming. We now have so many features out-of-the-box which helps write understandable code quite easy.

set fs=##class(%Stream.FileCharacter).%New()
set fs.Filename="c:\csvfile.csv"
while 'fs.AtEnd {
  set line=$listfromstring(fs.ReadLine(), ",")

  #; in line you will get listbuild for all columns in a row
​}

class %Stream.FileCharacter helps to read text files, which may contain text in different codepages, and line ends.

Or if you need to read some binary data, which should have some conversion on the fly, use %Stream.FileBinary.

I've already answered for exactly the same question at google groups

In first you should look at the official documentation which is available online here
You have very old system, so you should install new version of Ensemble at new windows server. Installation Guide 

And copy all of you data from old server to new. But it is may be very difficult task, without knowledge about your application.

As well you should look at Cache Upgrade checklists archive and latest, and Ensemble Release Notes

I've used Delphi so long ago, and could be mistaken. But to be sure that application is not interactive, it should not have any visual components. And as I remember you should start developing from Console Application. To check that actually it does work correctly, you may try with real console tool, something like: dir, md, etc.. You may try this $zf(-2,"dir > testdir.txt"), if after executing this code testdir.txt file will appaer with content for some folder, you'll see that it's work. And it means that in your application should be changed something to be as console application.

If to talk about REST and best practices, then I should say, to update some object or all collection you should use method PUT, while POST should be used only for creating new objects.

What about updating objects, actually it it could be inside objects. And I hope that InterSystems has some optimizations in this case. But I think it is mostly depends on you objects, how difficult they are, and how often you should change this objects. And you of course you can use some profile tools, to understand how many time spends while object is changing and for what.  In may opinion in first you should keep it as is, just update all properties from request, without any checking. Some time it is possible that checking for changes, may take more time, when just save it all.