Most of what I will say next comes primarily from the following source:
Harrison, Mark. Soviet and East European Studies, Soviet Planning in Peace and War 1938-1945, Cambridge University Press, 1985
Firstly, evacuation during Operation Barbarossa encompassed a lot more than just moving factories. It was a complete relocation of people, economy, and industry. It's very difficult to talk just about moving the factories without taking into account the rest of the context, but I will try to do so in a q&a format. I think I saw someone else in this forum do it for subject matters of this size with good effect, so I will try too.
Q: What constitutes as a factory?
A: Generally, most factories consist of, in order of importance:
Q: How did they dismantle them?
A: Generally, you took only what you needed, and packed them as much as possible in ad-hoc scaffolding of various design and shapes. Most of the machines were hard or impossible to disassemble, so the workers just hammered scaffolding around them. Some of the factories had special machines and scaffolds that served specific functions. These were prioritized and either cut up to be welded later or simply scuttled and left behind. Most of this labor was done by the workers, which, incidentally, were comprised of 50% women. [ Women in the Soviet Union, Mary Buckley, Feminist Review No.8, Summer, 1981].
Q: How did they move them?
A: Railroad, mostly. The Urals were not very kind of wheeled vehicles. Workers carried what they could on their persons, but the vast majority of equipment and machinery were hauled on trains. Most factories already had existing rail connections to the interior, so rail was essentially the most logical and perhaps only choice. It's a matter of contention on whether all of this was planned beforehand, or an ad-hoc thing where everyone just generally pitched together to make happen. I feel like a discussion on the planning behind the evacuation could be another thread all together.
Q: How did they put it all back together again?
A: Existing industrial infrastructure was used and re purposed as much as possible. Factory housing and garages were extended where possible, and the new factories were laid down on existing logistics nodes, generally by railroad. Railroad network extensions done in 38 and 39 also helped this greatly. Workers were housed in hastily erect bivouacs or even tents while this happened. The only thing you could not move were the furnaces, so new blast furnaces had to be erected. The good news is the Soviets had learned improved techniques which simplified and shortened the time it took to erect these furnaces, so rather than years, the new ones were operating in months.
Hope that helps.
Follow up question. OP states "most of their industiral factories".
Stalin developed a strong industrial base east, in Urals, central Asia and western Siberia, during the 1st and 2nd four year plans (1928-1932 and 1933-1937) which made a big difference compared to 1914-1917, esp in regards to the Ukraine.
Does anyone know what percentage of Soviet industrial production was still in the west in 1940? As well can anyone compare this to the situation with Tsarist industrial production in the west in 1914?
Was there any attempt from the Germans to prevent this from happening? Considering it all moved via rail, I am surprised they did not attempt to sabotage the infrastructure of the Soviet Union where it could during the invasion. The Stukas being dive bombers potentially could do significant damage to the rail system or even trains themselves.